Reputation: 85
Getting clipboard information in the background Works fine on android 9 But it doesn't work on android 10
Is there a way to get the clipboard information in android 10?
Thank you
clipboard = (ClipboardManager)getSystemService(CLIPBOARD_SERVICE);
clipboard.addPrimaryClipChangedListener(new ClipboardManager.OnPrimaryClipChangedListener() {
@Override
public void onPrimaryClipChanged() {
}
});
Upvotes: 4
Views: 2975
Reputation: 2044
As explained in Android 10 changes:
Limited access to clipboard data: unless your app is the default input method editor (IME) or is the app that currently has focus, your app cannot access clipboard data on Android 10 or higher.
There is no way around it, you can find more info on the official docs
Upvotes: 6