本文共 642 字,大约阅读时间需要 2 分钟。
public class YourItemSelectedListener implements OnItemSelectedListener { public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) { String selected = parent.getItemAtPosition(pos).toString(); } public void onNothingSelected(AdapterView parent) { // Do nothing. } } public class YourItemSelectedListener implements OnItemSelectedListener { public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) { String selected = parent.getItemAtPosition(pos).toString(); } public void onNothingSelected(AdapterView parent) { // Do nothing. } } spinner.setOnItemSelectedListener(new MyOnItemSelectedListener());转载地址:http://krbai.baihongyu.com/