Try this:
listView = (ListView) findViewById(R.id.my_list_view);
listView.setAdapter(someAdapter);
listView.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
switch(position) {
case 0:
Intent intent = new Intent();
intent.setClassName("com.test", "com.test.SubMenuActivity");
startActivity(intent);
break;
case 1:
// Do something else ...
break;
// ...
}
});
solved How can I make the my listview interactive? [duplicate]