Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I handle the browser's "share page" intent in android?
    primarykey
    data
    text
    <p>I read here ( <a href="http://androidlittle.blogspot.com/2009/08/intent-filter-for-share-link.html" rel="noreferrer">http://androidlittle.blogspot.com/2009/08/intent-filter-for-share-link.html</a> ) what intent-filter is required to handle the "share link" intent that the android web browser sends. I have placed this inside an block in my AndroidManifest.xml like so:</p> <pre><code> &lt;activity android:name=".ShareLink"&gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.SEND" /&gt; &lt;category android:name="android.intent.category.DEFAULT" /&gt; &lt;data android:mimeType="text/plain" /&gt; &lt;/intent-filter&gt; &lt;meta-data/&gt; &lt;/activity&gt; </code></pre> <p>I cannot for the life of me get this to be triggered though. When I share a link in the android browser, the emulator log shows it's creating a chooser intent, but doesn't give the details of the intent the chooser is acting on. No chooser window pops up, and the intent gets handled by the SMS application.</p> <p>I have also tried kicking off the intent manually:</p> <pre><code>adb shell am start -D -a android.intent.action.SEND -c android.intent.category.DEFAULT -t text/plain -d http://google.com/ </code></pre> <p>but the response I get is:</p> <pre><code>Starting: Intent { act=android.intent.action.SEND cat=[android.intent.category.DEFAULT] dat=http://google.com/ typ=text/plain } Error: Activity not started, unable to resolve Intent { act=android.intent.action.SEND cat=[android.intent.category.DEFAULT] dat=http://google.com/ typ=text/plain flg=0x10000000 } </code></pre> <p>Can anyone tell me what I'm doing wrong? My main (launcher) activity works fine, so I assume there is no issue with installation on the emulator.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload