例子:
另一个为OnItemSelectedListener,用法和上面一样
OnItemClickListener listener = new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
setTitle(parent.getItemAtPosition(position).toString());
}
};
view.setOnItemClickListener(listener);
另一个为OnItemSelectedListener,用法和上面一样