Associate an Activity with an item in XML ListViews in Android

Posted by John on Stack Overflow See other posts from Stack Overflow or by John
Published on 2010-03-22T03:21:11Z Indexed on 2010/03/22 3:31 UTC
Read the original article Hit count: 237

I have a ListView that is populated using an XML file. However, I want each item, when clicked, to start a new Activity related to that item.

I understand how to use OnItemClick to start a Toast that shows the selected item's text. However, since the ListView is populated from an XML there is not a specific Id for each item in the list.

So, how would I associate an Activity with each item in the ListView when the items do not have Ids?

© Stack Overflow or respective owner

Related posts about android

Related posts about android-widget