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
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With