Planned to implement a global context menu for text(Editext, Textview).
A new option should be there to add the selected word to my wordcollector kind of application. How to add the above option to global context menu.
Planned to implement a global context menu for text(Editext, Textview).
A new option should be there to add the selected word to my wordcollector kind of application. How to add the above option to global context menu.
you can change the application's context menu like this:
@Override
public void onCreateContextMenu(ContextMenu menu, View v,
ContextMenuInfo menuInfo) {
if (v.getId()==R.id.list) {
AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo)menuInfo;
menu.setHeaderTitle("EditText");
String[] menuItems = //your menu item. you can add the "add word to dictionary" as an item here.
for (int i = 0; i<menuItems.length; i++) {
menu.add(Menu.NONE, i, i, menuItems[i]);
}
}
}
You cannot change the Global context menu. You cannot override or hook functionality globally at the system level without the particular activity implementing an intent or activity that you expose. Even in the case of publishing an intent it wouldn't matter unless the application running is a consumer... and all the base system applications and obviously all applications prior to yours would not be without updating the app to consume.