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 to a database to display. I'm somewhat familiar with Android's Clipboard framework, but what I'm not sure how to do is to listen for copy "events" to know that a new item needs to be added to the clipboard.
To clarify, I need to be able to add a record to the database whenever the user copies something. How do I do this?
If you are using API level 11 (3.0) or above, then you can use addPrimaryClipChangedListener
which is documented here and there is some example usage here.
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