你能告诉我如何为每一个android listview项目设置clicklistener吗?我希望mij每个项目导航到不同的页面。
现在,我编写了以下代码,让所有项目都转到同一个页面:
list.setOnItemClickListener(new OnItemClickListener() {public void onItemClick(AdapterView arg0, View arg1, int position,long arg3) {
startActivity(new Intent(Participant.this,Contact.class)); }
});发布于 2014-02-17 23:34:17
当然,所有的项目导航到相同的page...the代码,每个项目都是一样的!您必须为每个项目调用不同的Intent(),这取决于其位置或项目的视图类型或其他所有类型的信息。
检查Intent documentation并查看它的构造函数。
此外,获得一个好的教程(网站已满)也可以帮助你。
好好享受吧。
https://stackoverflow.com/questions/19810549
复制相似问题