Varada
Varada

Reputation: 17042

Listview with onclick event problem

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, another intent should be started... How could we do this?

Upvotes: 0

Views: 466

Answers (3)

Heatork
Heatork

Reputation: 31

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.

Upvotes: 0

sat
sat

Reputation: 41076

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

Upvotes: 0

Vincent Mimoun-Prat
Vincent Mimoun-Prat

Reputation: 28541

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

Upvotes: 1

Related Questions