有时候我们需要将文件用我们的APP 打开,就像这样:
一,我们需要在清单文件中进行一些信息配置,让它们可以检测到我们的APP。
因为我们需要的文件类型就下面这些,所以加入指定类型,如果所有类型都支持,可以
<data android:mimeType="*/*" />
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<!--<data android:mimeType="*/*"/>-->
<data android:mimeType="video/*" />
<data android:mimeType="image/*" />
<data android:mimeType="application/pdf" />
<data android:mimeType="application/msword" />
<data android:mimeType="application/vnd.openxmlformats-officedocument.wordprocessingml.document"/>
<data android:mimeType="application/vnd.ms-excel"/>
<data android:mimeType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"