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() {
}
});
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With