Shriram
Shriram

Reputation: 4411

Opening ContextMenu by Clicking a Button in Android

How to open the ContextMenu in Android by Clicking a Button?

Upvotes: 0

Views: 2246

Answers (2)

Gusdor
Gusdor

Reputation: 14334

Your question is bad and you should feel bad, given how readily available (if cryptic) the method behind this process is. This small tutorial helped me greatly.

http://www.mikeplate.com/2010/01/21/show-a-context-menu-for-long-clicks-in-an-android-listview/

Upvotes: 0

Vinay
Vinay

Reputation: 2415

A context menu is conceptually similar to the menu displayed when the user performs a "right-click" on a PC. You should use a context menu to provide the user access to actions that pertain to a specific item in the user interface.

On Android, a context menu is displayed when the user performs a "long press" (press and hold) on an item.

Alternatively, if you need a button, you can implement the menu for the view and change the content dynamically.

Upvotes: 1

Related Questions