The copy/paste feature used to work in my app. But once I have upgraded my apps SDK to target Android 10, it doesn't get the correct data. Eg. If I copy "Hello" from chrome, open my app and paste it, Hello is pasted. Now if I go to chrome without killing my app and copy "World", open my app and paste, "Hello" is pasted.
There have been some changes related to privacy in Android 10: https://developer.android.com/about/versions/10/privacy/changes#clipboard-data
My onPrimaryClipChanged()
callback isn't triggered on Android 10 with my app getting the SDK upgrade as well.
Is there any solution to this, kindly give a suggestion?
There's only one solution: asking for permission android.permission.READ_LOGS
and then use logcat
or dumpsys
command to get the clipboard. This permission must be granted via ADB
.
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