这是我的代码段:
protected void onListItemClick(ListView l, View v, int position, long id) {
super.onListItemClick(l, v, position, id);
Toast.makeText(MainActivity.this, "clicked " +
position, Toast.LENGTH_SHORT).show();
}
答案 0 :(得分:0)
您可以点这个链接:
ArrayList<String> list;
listView.setOnItemClickListener(new OnItemClickListener()
{
public void onItemClick(AdapterView<?> arg0, View arg1, int position,
long arg3)
{
ArrayList<String> newList=new ArrayList<String>();
newList=list.get(position);//Text will be featch according to the position
String name=newList.get(0).toString();
}
}