I am having problem setting OnClickListener to my listview. I want to open different activities when different listview item is being clicked. But i am not able to get it done.
I don't see where you set an OnClickListener
for your View
though. Inside of your ListAdapter
's getView()
, you should do
View v = super.getView(position, convertView, parent);
if(v != null) {
v.setOnClickListener(new View.OnClickListener() {
Intent intent = new Intent(YourContext, ActivityToStart.class);
startActivity(intent);
});
}
I hope that helps.