Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Long press list item to open pop up menu

Hello im trying to make a small menu pop up once an item is long pressed in my list view can some one point me in the right direction to accomplish this?

like image 911
DMcP89 Avatar asked May 10 '11 20:05

DMcP89


People also ask

How do I open pop up menu?

Go to app > res > menu > right-click > New > Menu Resource File and create a menu resource file and name it as popup_menu. In the popup_menu file, we will add menu items. Below is the code snippet for the popup_menu. xml file.

Which menu will display after long press click on any view?

Android Popup Menu displays a list of items in a vertical list which presents the view that invoked the menu and is useful to provide an overflow of actions that are related to specific content.

What displays a pop up menu?

A PopupMenu displays a Menu in a modal popup window anchored to a View . The popup will appear below the anchor view if there is room, or above it if there is not. If the IME is visible the popup will not overlap it until it is touched. Touching outside of the popup will dismiss it.

Which of the following is a type of menu associated with a view and appears when you long press that view in Android?

Context menu and contextual action mode A context menu is a floating menu that appears when the user performs a long-click on an element.


1 Answers

These posts contain possible solutions to your problem:

  • Long click on list activity item
  • Show a context menu for long-clicks in an Android ListView
  • Click & Long-Press Event Listeners in a ListActivity
  • ContextMenu not popping up on Long click

I hope it helps.

like image 67
CRM Avatar answered Oct 02 '22 17:10

CRM