Skip to content

Instantly share code, notes, and snippets.

@talklittle
Created March 14, 2017 14:03
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save talklittle/1a198d70a36ac32be4cb8e3d33a0e279 to your computer and use it in GitHub Desktop.
Save talklittle/1a198d70a36ac32be4cb8e3d33a0e279 to your computer and use it in GitHub Desktop.
AndroidManifest.xml intent filter for YouTube videos
<manifest>
<application>
<activity android:name="com.example.MainActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" android:host="www.youtube.com" android:pathPrefix="/watch" />
<data android:scheme="https" android:host="www.youtube.com" android:pathPrefix="/watch" />
<data android:scheme="http" android:host="youtube.com" android:pathPrefix="/watch" />
<data android:scheme="https" android:host="youtube.com" android:pathPrefix="/watch" />
</intent-filter>
<!-- separate intent-filter to avoid host/pathPrefix "bleeding" -->
<!-- https://stackoverflow.com/questions/31002909/android-deeplink-pathprefix-attribute-is-being-ignored -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" android:host="youtu.be" />
<data android:scheme="https" android:host="youtu.be" />
</intent-filter>
</activity>
</application>
</manifest>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment