1

这是我的代码片段:

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();
}
4

1 回答 1

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(); 
    }
}
于 2012-11-21T10:55:23.917 回答