i have created a custom listview with pictures and text, now i want to open an activity for each item on the list, how do i do that? i know how to toast i just dont know how to open a new activity for each item on the listview. bellow is my Code
i know how to use intents to open new activities,send sms and email, i dnt know how to do it with a list view. you see a in a button you just create a button and use its ID e.g (for imageButtons)
ImageButton buttonConDBN= (ImageButton) findViewById(R.id.buttonConDBN);
buttonConDBN.setOnClickListener(
new ImageButton.OnClickListener() {
@Override
public void onClick(View v) {
Intent i = new Intent(ContactUs.this, DBN.class);
startActivity(i);
}
}
);
now with a listview there are more that one items, so how do you specify which one and create its intent
Sorry, I'm not following. You have the position parameter, so what prevents you from using it in whatever way you need to? What is the precise problem you're stuck on? The code line with cars doesn't make things clear without explanation.