我有一个ListView圣维特一些项目。
I have a listView vith some items.
我想从我的onClickListener名字所选项目的(字符串),就搞定了。
I would like to get from my onClickListener the name (String) of the selected item.
我知道如何让所选择的位置,但如何找到这个元素的字符串?
I know how to get the selected position but how to find the String of this element?
下面是我的点击监听器:
Here is my on click listener:
journalNames.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view,int position, long id)
{
}});
我的ListView填充了从数据库中的一些查询。
My listView is populated with some query from the database.
感谢你。
怎么样,
journalNames.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view,int position, long id)
{
String selectedFromList = (journalNames.getItemAtPosition(position).getString());
}});