ListView OnClick XML output
-
11-11-2019 - |
题
I am using an XML (HttpPost) on ListView to display a list of items in my application. XML File passes the following sample data:
id=5
name=Name2
score=20
The problem I am facing is with the OnItemClick:
public void onItemClick(AdapterView parent, View view, int position, long id) { lv.getItemAtPosition(position);
AlertDialog.Builder alert = new AlertDialog.Builder(context);
alert.setTitle("Selected Name: " + lv.getItemAtPosition(position));
Here lv is the listview. The out put shows:
Selected Name: {id=5, name=Name2, score=20}
What should I be doing if I need an output like:
Selected Name: Name2
Thanks Ram
没有正确的解决方案
不隶属于 StackOverflow