这是我的代码片段:
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();
}
这是我的代码片段:
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();
}
您可以点击此链接:
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();
}
}