How to send highlighted text to Activity?
I am new in Android Application Development.
Research:before asking this question, I have read topics related with my
question(How to send string from one activity to another?). Unfortunately
they are explaining how to copy string from one activity to another
activity.
My intention:User opens default browser of mobile phone, highlights text
and clicks the button which will be added by me on menu and needed
activity is opened with highlighted(copied) text
Tried:I have added intent filter to activity, then added action
(android.intent.action.SEARCH) and
category(android.intent.category.DEFAULT) into intent-filter. I thought,
link for activity will be in Search section after Google, Google
Translate, Wikipedia, Dictionary. Also, tried
android.intent.action.ACTION_SEARCH_LONG_PRESS. Also,
android.intent.action.SEND. Why it is not working, I have no idea.
<activity android:name="ActivityDate">
<intent-filter android:label="Lesson">
<category android:name="android.intent.category.DEFAULT"/>
<action android:name="android.intent.action.SEND"/>
</intent-filter>
</activity>
Questions(I have many questions. I will try make them short and ask the
most importants for me)
Question 1:Is it possible to add button within menu(which opens when text
is highlighted. It includes copy, search, share) ?
Question 2:If it is possible, how to do that? How to make button so that
when it is clicked, highlighted text should be send to my activity?
Question 3:If I could do this function for default browser can I implement
to other applications(3rd party applications)?
I hope for your help.
Gayrat
No comments:
Post a Comment