覆盖Android的一般粘贴上下文菜单上下文、菜单、Android

2023-09-06 11:07:04 作者:归戾

我认为这是不可能的,但我认为这是更好地问别人谁知道了肯定的答案。

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

是否有可能创建一个影响上下文菜单中所有应用程序的Andr​​oid应用程序,这样,当用户长preSS编辑文本视图,不仅粘贴选项将是可见的,而且我的个性粘贴功能?

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?

我想要做的是很容易让用户导入从我的应用程序的文本不留他们在工作中的应用。有一件事我已经想好了是创建监听pressing容积服务向上和向下的同时,我的文本字符串复制到剪贴板。然后,用户还必须使用普通的粘贴功能。

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.

推荐答案

没有,你不能。上下文菜单中的每个应用程序定义,你不能(也不应该)从另一个应用程序的其他应用程序的行为发生改变。

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.