I am trying to implement item click listener on my list in my main class that extends Activity, because for some reason if i extend ListActivity and expand my list with setListAdapter, the app force closes on startup, but if i extend Activity and expand it with setAdapter it runs fine.
Now my problem is i cannot find a way to implement a click listener for my list, I have tried implementing it in the custom ListAdapter.
The list clicks are going to open another activity which has another list.
——Updated——
@Override
public void run() {
// call any new activity here or do any thing you want here
final Intent intent = new Intent();
if(selectedListItem == 0) {
intent.putExtra("value1", "value1");
intent.setClass(this, com.lister.listexample.ListexampleActivity.class);
}
startActivityForResult(intent, selectedListItem);
}
Change ListView background – strange behaviour
check the above link where i mentioned a list example. that will enable you to trick down your list problems.
Try making a sample project first by copy pasting the above example. then you will be able to understand the answer better
Hope it helps 🙂