我无法下载(从网络和电子邮件)未知的扩展,例如(*.ini、*.zip、*.ddd) 除非存在可以理解扩展的应用程序。
例如,在下载“Astro”应用程序之前,我无法从浏览器(或电子邮件)下载 *.ini 文件。
- 如何才能绕过它们以便可以下载?
- 如何注册您的应用程序以了解一定的扩展,以便可以下载?
最佳答案
How can you by pass so that they are downloadable?
你不知道。
How can you register your app to understan certain extention so that it can be downloadable?
理想情况下,您不需要。您可以通过 MIME 类型来完成。文件扩展名非常脆弱。然而,两者都可以通过使用 <data>
来实现。您 Activity 中的元素 <intent-filter>
.您还需要 BROWSEABLE
类别,可能是 VIEW
行动。
例如,您将如何安排查看 PDF 文件的选项:
<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>
关于android - 无法下载未知扩展,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4340379/