LIstView添加点击事件

listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {br/>@Override
public void onItemClick(AdapterView<?> adapterView, View view, int p, long l) {
Toast.makeText(MainActivity.this, "Click item" + name[p], Toast.LENGTH_SHORT).show();
}
});

猜你喜欢

转载自blog.51cto.com/11623741/2105615

相关文章