This is my affected code
Object[] rooms = new Object[]{
new OnItemSelectedListener() {
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
tmEditor.putInt("level", position);
}
public void onNothingSelected(AdapterView<?> parent) {
}
},
new OnItemSelectedListener() {
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
tmEditor.putInt("amount", position);
}
public void onNothingSelected(AdapterView<?> parent) {
}
}
};
The problem is when I call it somewhere else with
((Spinner) widget).setOnItemClickListener((OnItemClickListener) rooms[1]);
Then I get a cast exception error
java.lang.ClassCastException: com.ssttevee.Loki$1$8 cannot be cast to android.widget.AdapterView$OnItemClickListener