I have a simple ArrayAdapter. I want to set up a listener for every row click of my list such that a new Activity opens. How would I do that? My ArrayAdapter code -
Assuming you are using a ListActivity
implementing OnItemClickListener
you could use this code:
ArrayAdapter
EDIT:
Otherwise, if you don't extend ListActivity, have a listview in your layout and replace ListView list = getListView()
with something like ListView list = findViewById(R.id.listView)
. Replace list.setOnItemClickListener(this)
with
list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView> parent, View view, int position, long id) {
}
});