ListView点击事件

// 绑定监听
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Fruit f = fruitList.get(position);
Toast.makeText(MainActivity.this, id + "|" +f.getName() , Toast.LENGTH_LONG).show();
}
});

posted @ 2017-04-17 15:20  rorshach  阅读(191)  评论(0编辑  收藏  举报