2013-06-22 42 views
3

我试图从Youtube应用程序接收意图。即当我按分享它应该列出我的应用程序准备接受这个意图的应用程序。但所有这些工作Youtube意向过滤器和计划

<intent-filter> 
    <action android:name="android.intent.action.SEND" /> 
    <category android:name="android.intent.category.DEFAULT" /> 
    <data android:mimeType="image/*" /> 
    <data android:mimeType="video/*" /> 
    <data 
    android:host="*" 
    android:scheme="youtube" /> 
    <data 
    android:host="*" 
    android:scheme="vnd.youtube" /> 
</intent-filter> 

或行动VIEW

<intent-filter> 
    <action android:name="android.intent.action.VIEW" /> 
    <category android:name="android.intent.category.DEFAULT" /> 
    <data android:mimeType="image/*" /> 
    <data android:mimeType="video/*" /> 
    <data 
    android:host="*" 
    android:scheme="youtube" /> 
    <data 
    android:host="*" 
    android:scheme="vnd.youtube" /> 
</intent-filter> 

有关如何获得意图的任何想法,以及发送一次? 感谢

+0

同样的情况,您是否找到解决方案? – cprcrack

+0

您是否找到解决方案? – Dan

回答

0

的YouTube应用程序发送text/plain数据,所以注册您的活动为MIME类型的接收器:

<intent-filter> 
    <action android:name="android.intent.action.SEND" /> 
    <category android:name="android.intent.category.DEFAULT" /> 
    <data android:mimeType="text/plain" /> 
</intent-filter> 
0
 <intent-filter> 
      <action android:name="android.intent.action.SEND" /> 
      <category android:name="android.intent.category.DEFAULT" /> 
      <data 
       android:host="www.youtube.com" 
       android:mimeType="text/*" /> 
     </intent-filter> 
     <intent-filter> 
      <action android:name="android.intent.action.SEND" /> 
      <category android:name="android.intent.category.DEFAULT" /> 
      <data 
       android:host="m.youtube.com" 
       android:mimeType="text/plain" /> 
     </intent-filter>