1

Hie!

I'm trying to develop an app that will do one of these 2 options -

  1. whenever a user marks a text in any app (using the regular copy/paste), there will be another option besides copy/cut that will open my app. (preferred)

  2. My app would listen to a copy text event in another app and will show a notification to the user. when they press it, it will open my app.

I haven't found a way to do either of these options.Some claim that I can listen to the copy activity but I couldn't understand how to do it(Android : How to listen to longclick events in any text area in other applications? click-events-in-any-text-area-in-other-application).

I'm not looking for anyone to write the code for me of course, just a pointer to the right direction if this is possible.

Thanks in advance, Shahar

Community
  • 1
  • 1
Shahar Zrihen
  • 81
  • 1
  • 6

2 Answers2

0

After short investigation I don't think it is possible. You may look at this guide, but it says copy/paste is implemented using ClipboardManager in Android, which looks like a part of a system. And it doesn't provide any hooks or interfaces to intercept copy/paste events in other app. Sure you may hack deeper in this mechanismus on rooted device, but this will not work for all users.

Andrew
  • 319
  • 2
  • 16
0

Very late response but you can create a custom text selection action, which is an activity with an intent filter with action android.intent.action.PROCESS_TEXT, and whenever a user press on text, a text selection menu appears, your's will be available too, when the user clicks on your custom text selection action, the activity configures with the android.intent.action.PROCESS_TEXT will be opened for your users.

check this article for implementation steps Custom text selection action