public abstract void onItemSelected (AdapterView<?> arg0, View arg1, int arg2, long arg3)参数

来源:互联网 发布:研究人工智能的意义 编辑:程序博客网 时间:2024/06/01 07:56

public abstract void onItemSelected (AdapterView<?> arg0, View arg1, int arg2, long arg3)

arg0   The AdapterView where the selection happened   解析:我们可以假单的看为下拉框(当我们为下拉框添加这个监听器时可以这么做),其他情况类似

arg1     The view within the AdapterView that was clicked  对应的就是ArrayAdapter构造函数中的第二个参数R.layout.list_item

arg2              The position of the view in the adapter    第一项position=0,第二项position=1...

arg3    The row id of the item that is selected

原创粉丝点击