I have a list view in which I show data. When I click on a row of the list view, I want to display data for that row from web services. How do I do that?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
What you do is set the
ListView‘sOnItemClickListenerwith thesetOnItemClickListenermethod. You then obtain the “item object” for the clicked item with thegetItemAtPositionmethod:The type of the “item object” (
oin the example above) depends on theListAdapterthat the list view is using. One common choice isCursorAdapter, in which case the type of the item object is conveniently theCursorto the record corresponding to the list item that was clicked.