How to embed an activity in android which gets activated every time user long presses on any text or url in specific applications , like facebook or whatsapp, on the phone.
-
Did you try anything? Do you have a specific problem? – il_raffa Jun 19 '15 at 14:45
-
i havent really tried it yet but was wondering about the path about which ill have to do it – Abhigyan Anand Jun 19 '15 at 15:26
1 Answers
This is not possible.
The closest thing that fits your requirement is in the upcoming Android M release, where your app can publish an ACTION_PROCESS_TEXT
activity. Your activity will then be an option in the floating action mode in an EditText
(and perhaps elsewhere with selectable text). If the user chooses your activity's entry in that action mode, your activity will be started and can get at what the user selected.
However:
This is not "every time user long presses on any text or url", in that the user still has to choose your activity from the action mode,
This is not for "specific applications", but all applications, and
Since we are seeing this in a developer preview, it is possible that by the time Android M ships as a production OS, that this feature is dropped or altered

- 986,068
- 189
- 2,389
- 2,491
-
thanks for the info....ill have to comeup with a different way of importing data in that way – Abhigyan Anand Jun 19 '15 at 15:27