Reputation: 668
I'm writing an English to Persian dictionary for Android. It works fine as a standalone application, but I need it be resident in memory and user be able to call ( run ) it on other applications. For example, user is reading an English text from a web page and needs a word to be translated. He highlights the word, and dictionary application automatically shows the translation.
Thanks for your help.
Upvotes: 1
Views: 2072
Reputation: 1793
Currently it is not possible to add some action after selecting text.
But there is another approach, after user select some text, he can choose share button, and share it to your application. Your Android Manifest must contain something like this, to handle it:
<intent-filter>
<action android:name="android.intent.action.VIEW"></action>
<category android:name="android.intent.category.DEFAULT"></category>
<data android:mimeType="image/*" ></data>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND"></action>
<category android:name="android.intent.category.DEFAULT"></category>
<data android:mimeType="image/*" ></data>
</intent-filter>
Upvotes: 2