开发者

Listview with onclick event problem

开发者 https://www.devze.com 2023-02-19 12:28 出处:网络
Hi all I would like to createa listview in android with items populated from the database. On clicking each item, as in the message inbox, where opening a message will redirected to anther page with c

Hi all I would like to create a listview in android with items populated from the database. On clicking each item, as in the message inbox, where opening a message will redirected to anther page with complete message, anoth开发者_如何转开发er intent should be started... How could we do this?


See ListActivity and OnItemClickListener. Google will give you plenty of examples.


check this
http://www.androidpeople.com/android-custom-listview-tutorial-part-2
onItemClick, call another activity.


I am a new man of Android developer,it's my pleasure to communicate with you. ^_^

  1. First you should call setListAdapter() to see up a adapter for your Listview

  2. Then you must set the listener for the Items of your list:setOnItemClickListener()

More: see the sample from Android developers Guide:Resources->Tutorials->Hello, Views ->ListView

Hope that my answer can help you.

0

精彩评论

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

关注公众号