Hello there; I am just seeking some advice.
I want to create layouts that contain a LinearLayout, which contains both a TextView and a ListView. I would like each page to only have one TextView, which I will load text into, using setText(), and I would like the ListView to be populated using a SimpleCursorAdapter or ArrayAdapter. However, the problem that I am running into now is how to attach a Listener to the ListView, in order to act once the user has clicked one of the items, and then send an identifier representing the selected item to another function.
Every example and tutorial I have seen online regarding this makes the whole class a ListActivity and then implements an onListItemClick() method. Is there any other way to do this? When I try to adapt my class to this format, I get force close's.
EDIT: Is this what I should be using?
AdapterView.OnItemClickListener | Android Developers
If so, does anyone have an example of how (Just want to make sure I'm doing it correctly)? Thanks!