Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to add some item in the context menus of android (system menu)

When I enter some text and press and hold on it then context menu is presented with items like cut,copy,select text and so on.

Is there any way to add my own custom item to this context menu ? I do not how this things works but I guess that should be possible to register something in the manifest just like registering activities and broadcasts . . .

Thanks,

Any ideas are wellcomed

enter image description here

like image 521
Lukap Avatar asked Nov 01 '11 13:11

Lukap


People also ask

What are the options available in the context menu?

If the end user right-clicks in Excel, however, the context menu also includes shortcuts for insert cell, delete cell, paste special and other commands that are commonly used for that program. User interaction with context menus depends upon the computing device, its operating system (OS) and it input mechanisms.

What is difference between Option menu and context menu in android?

Context Menu - the menu shown when you press and hold an item. Show activity on this post. Google provides an extensive summary of the different menu types in their documentation. The options menu is the primary collection of menu items for an activity.

How do I add a context menu to a list view?

Android context menu appears when user press long click on the element. It is also known as floating menu. It affects the selected content while doing action on it. It doesn't support item shortcuts and icons.


Video Answer


1 Answers

Is there any way to add my own custom item to this context menu ?

Only for widgets in your own activities, not for the system as a whole.

Also, EditText is problematic even for your own activities, as some device manufacturers are bypassing the normal context menu system, so you can't add to them.

That being said, for your own activities, just follow the instructions to create a context menu for the widgets of interest.

like image 186
CommonsWare Avatar answered Sep 30 '22 19:09

CommonsWare