please look this screenshot. In normal case, when text be selected, a popup menu opened, but only have cut/paste item. I want to know, how to add item just like this "web search / share" into this popup menu?
What's this popup menu? I had tried to override Activity Context or Option Menu, but it' not. I had also tried to extends TextView and override it's Context menu, but no use, only show a normal dialog context menu, and this cut/paste menu disappered.
Before the api23,I have no ideal too. But now we can get it use ACTION_PROCESS_TEXT
with api23.
Include this code in the AndroidManifest.xml file.
<activity
android:name=".YourActivity">
<intent-filter>
<action android:name="android.intent.action.PROCESS_TEXT" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
</activity>
Install your app, then you can find your app name in the text selection menu.
Read the documentation for more information.
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