• Post Reply Bookmark Topic Watch Topic
  • New Topic

listview item click

 
Aris Doxakis
Ranch Hand
Posts: 136
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 73
Android Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!