Вопрос

I've been searching fort this from last 2 days, but sorry to say i've not got any satisfied answers. My question is whenever a Youtube url is clicked in android device it should list my app as Complete action using I've tried a lot but not getting it. Here is the code i've tried.

 <intent-filter>
     <category android:name="android.intent.category.BROWSABLE" />
     <category android:name="android.intent.category.DEFAULT" />

     <action android:name="android.intent.action.VIEW" />

     <data android:scheme="http://www.youtube.com/watch?v=" />
</intent-filter>
Это было полезно?

Решение

Finally I got the answer. Hope this will help some one else.

<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:host="*.youtube.com"
                android:pathPrefix="/watch"
                android:scheme="http" />
            <data
                android:host="*.youtube.com"
                android:pathPrefix="/watch"
                android:scheme="https" />
</intent-filter>

Другие советы

<intent-filter>
<data android:host="www.youtube.com/watch?v=" android:scheme="http" ></data>
 <category android:name="android.intent.category.BROWSABLE" />
 <category android:name="android.intent.category.DEFAULT" />
 <action android:name="android.intent.action.VIEW" />
</intent-filter>
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top