android - 无法下载未知扩展

标签 android download

我无法下载(从网络和电子邮件)未知的扩展,例如(*.ini、*.zip、*.ddd) 除非存在可以理解扩展的应用程序。

例如,在下载“Astro”应用程序之前,我无法从浏览器(或电子邮件)下载 *.ini 文件。

  1. 如何才能绕过它们以便可以下载?
  2. 如何注册您的应用程序以了解一定的扩展,以便可以下载?

最佳答案

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/

相关文章:

android - 打开HAX设备失败! HAX 不工作,模拟器在仿真模式下运行

PHP file_get_contents() 超时?

iphone - 在下载文件之前检查 iphone 设备上是否有足够的空间

android - 如何为 ListView 下载图像设置条件?

android - ViewPager 内的水平 ScrollView

android - 更新 ListView ?

java - Android 媒体播放器返回 NullPointerException

android - 用户快速触摸 MediaController。错误只发生在 Nexus 4 上。

html - 有什么方法可以在 IE 中下载 HTML5 属性吗?

android - android中如何处理图片下载不完整的情况?