开发者

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

how to get custom dialog activ开发者_运维问答ity while clicking on listview in android?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜