2014-01-08 58 views
0

我有這個場景從Intent.ACTION_VIEW獲取URL

從電子郵件附件(gmail)打開文件 - >查看並保存到我的應用程序。

對於這個處理我已經在manifest.xml中

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

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

       <data android:scheme="content" android:mimeType="*/*"/> 
       <data android:scheme="file" android:mimeType="*/*"/> 


      </intent-filter> 

加入這個當我取這個數據回我不明白的URL回來intent.getData()或通過臨時演員。 我可能會錯過一些非常簡單的事情。

歡呼聲, Saurav

回答

0

請做這樣

<intent-filter> 
    <action android:name="android.intent.action.VIEW" /> 
    <action android:name="android.intent.action.EDIT" /> 
    <category android:name="android.intent.category.DEFAULT" /> 
    <data 
    android:mimeType="application/mytype" 
    android:host="*" 
    android:pathPattern=".*\\.mytpe" 
    /> 
</intent-filter> 
+0

它並沒有幫助。 Android視圖意圖是否發送URI? – saurav