Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to make an intent filter for specific apps?
    primarykey
    data
    text
    <p>I'm writing an app to post on a forum. On this particular forum, it's possible to embed youtube videos in your post. Now there is a youtube app for android, and as you are watching a video on that app, there is an option to share that particular video. A list of applications will appear to send this video to.</p> <p>Unsurprisingly, I wanted to add my application to that list. After alot of research and testing, I found that the following code, added to the manifest, did in fact add my application to that list.</p> <pre><code>&lt;intent-filter android:label="Post embed"&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; </code></pre> <p>However, my app is now added to a lot of these "share"-lists from other apps, that do not send a youtube video. I figured this might be solved by extending the intent filter to either only accept intents from certain apps (which I don't know is possible) or to put some restraints on the intent as to what data it is carrying. This is where I'm stuck.</p> <p>As for the second idea, I would not know what data the youtube app is sending so that I can distinguish it from other apps.</p> <p>So the general question would be: How can one find out what data an app sends in an intent, so that one might distinguish it from intents sent by other apps? Also, how would one add restrictions to his intent filter accomplish this?</p>
    singulars
    1. This table or related slice is empty.
    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.
    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