The moose likes Android and the fly likes listview item click Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Mobile » Android
Reply Bookmark "listview item click" Watch "listview item click" New topic
Author

listview item click

Aris Doxakis
Ranch Hand

Joined: Dec 05, 2004
Posts: 132

Good morning,
i have a list of products, when a user clicks on a item, i want a small menu to open with a title and 2 options, ADD and View. How can i do this? And if a user clicks on view it opens a new activity, and if the user clicks on the ADD item it adds a product to a list.

thanks in advance.
Pranav Raulkar
Ranch Hand

Joined: Apr 20, 2011
Posts: 73

Hi Aris,
what you can do is make your Activity implement OnItemClickListener for ListView. Then on click of a particular row, you can pop up dialog where you can implement your layout and logic. Even better, you can long press a row that pops up a context menu containing your choices. Once a choice is selected you can use intent to fire the new activity. Hope this helps.
 
 
subject: listview item click
 
Threads others viewed
Please Help - Remove only the duplicated ITEM and NOT the original item that was duplicated.
Many to Many problem
Click on the button
add listener to combo drop down list
access html form element value in servlet
MyEclipse, The Clear Choice

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture