tags:

views:

125

answers:

1

how to get custom dialog activity while clicking on listview in android?

A: 

it's not very clear what you want.

i'm assuming you want a dialog activity to launch if you click an item in your list view. if that is true, something like this would work.

@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
  Intent i = new Intent(getApplicationContext(), DialogActivity.class);
  startActivity(i);
}

an alternative is to have the item click create an intent to spawn an activity and store some extras in that intent (say what that item you selected was). when that new activity starts, you can have it pop up a dialog activity.

yanokwa