Listener for clipboard content change?

Regex Rookie picture Regex Rookie · Mar 7, 2011 · Viewed 10.1k times · Source

Is there a way to register a method so that it's automatically called as soon as the user ends "text selection mode" (thereby copying selection to clipboard)?

Answer

Matthew Willis picture Matthew Willis · Mar 7, 2011

I think you're looking for ClipboardManager.addPrimaryClipChangedListener().

Edit - this is for Android 3.0, and I don't see any other clipboard-related apis in the earlier levels.

Also see the ClipboardManager docs in the copy and paste guide.