1

Is it possible to capture paste event from ClipboardManager? I am able to get copied data using method onPrimaryClipChanged() of ClipboardManager.OnPrimaryClipChangedListener.

The question is in context to an app which uses Accessibility API.

Community
  • 1
  • 1
  • have look [Clipboard copy & paste](https://stackoverflow.com/questions/19177231/android-copy-paste-from-clipboard-manager) – Hemant Parmar Jan 19 '18 at 09:38
  • I need to capture the moment as soon as it is pasted anywhere i.e. irrespective of application. – Riteeka Chhabra Jan 19 '18 at 09:50
  • capture the moment means what? you want copy some from clipboard and paste somewhere ? – Hemant Parmar Jan 19 '18 at 09:51
  • Thanks for your efforts, but this doesn't solve the purpose as i may be dealing with any other app a user can have in his device e.g. google chrome, where i think i can-not get the view as EditText. – Riteeka Chhabra Jan 19 '18 at 10:16

1 Answers1

1

Digging further, I found the Paste event is captured in AccessibilityEvent.TYPE_VIEW_TEXT_CHANGED.

TYPE_VIEW_TEXT_CHANGED, is an event type which can be handled while extending AccessibilityService.

Posting answer, Just in case it help someone else, as i approximately Spent a day to achieve it.