I am trying to detect when a user pastes something outside of my application while my app is running in the background. Specifically, when they hold down and hit the paste button I need to retrieve that action.
Do any of you know how to implement this functionality?
It's not possible anymore due to privacy and security concerns.
From Google: Privacy Changes on Android 10:
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.