如果我有 2 个微调器取决于类型 ArrayList>
spinner2.setOnItemSelectedListener(new OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int position, long id) {
ArrayList<HashMap<String, String>> arrList = new ArrayList<HashMap<String,String>>();
for (HashMap<String, String> map2 : arrList) {
String value = map2.get("SectionID");
// Do something
Context context = getApplicationContext();
int duration = Toast.LENGTH_SHORT;
Toast toast = Toast.makeText(context, value, duration);
toast.show();
Log.d("wwwwwwwwwwwwwwwwwwww: ", value);
// Do something
}
}
@Override
public void onNothingSelected(AdapterView<?> adapter) {
}
});
我确实喜欢这样,但是发生了事情并且 logcat 没有错误