How to listen for a copy in Android

后端 未结 3 1654
-上瘾入骨i
-上瘾入骨i 2021-01-11 18:30

To get myself a little more familiar with content providers in Android, I\'m making a small clipboard manager app. Its core functionality is to simply add whatever you copy

3条回答
  •  长发绾君心
    2021-01-11 19:03

    What API do you have? This answer: Listener for clipboard content change? seems to suggest that there is a way for android 3.0 and higher, but not lower, unfortunately.

    The only other thing I can think of is making a service, querying the clipboard every so often to see if it has changed or has new text. This can be easily done using ClipBoardManager.

提交回复
热议问题