2017-10-07 90 views

回答

1

就在這個意圖過濾器添加到您的PDF活動

<activity name=".YourPdfActivity"> 
<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:mimeType="application/pdf" /> 
</intent-filter> 

+0

只有當你希望能夠從Web瀏覽器,這進一步意味着你將能夠調用包括'BROWSABLE'使用'http' /'https''Uri'方案。 – CommonsWare

+0

如何找出我要打開的文件在哪裏? –

+0

在你的onCreate()方法中,只需調用getIntent()。getData()來訪問文件uri,你想打開 –

相關問題