Override the general paste context menu in Android

a 夏天 提交于 2019-12-22 01:05:13

问题


I think that this is not possible but I think it is better to ask someone who knows the answer for sure.

Is it possible to create an android application that affect the context menu in all applications so that when the user long press an edit text view, not only the paste option will be visible but also my customized paste function?

What I want to do is to make it easy for the user to import texts from my application without leaving the application they are working in. One thing I have thought off is to create a service that listen for pressing volume up and down at the same time and copy my text string into the clipboard. The user must then also use the ordinary paste function.


回答1:


No, you cannot. The context menu is defined in each app, and you cannot (and should not) change the behavior of other applications from another application.

Though there may be valid use-cases for such a feature, it is a bad idea in general.



来源:https://stackoverflow.com/questions/14759409/override-the-general-paste-context-menu-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!