【问题标题】:Custom File Format not recognized on device设备无法识别自定义文件格式
【发布时间】:2017-07-20 20:27:38
【问题描述】:

我在我的 android 应用程序中有一个自定义文件格式 (.ft),我在清单中注册为某些活动的意图过滤器

<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:host="*"
         android:mimeType="application/ft"
         android:scheme="content" />

</intent-filter>

在模拟器中,我可以点击文件(例如通过电子邮件设置文件时),然后应用程序按预期启动。

但是最近我一直将我的应用程序打包为 APK 并将其分发以进行一些测试,并且在没有设备上识别文件格式,即使我的应用程序已安装......我是否缺少注册文件格式的任何内容?

更新 再摆弄一下之后,似乎我可以从 Android 邮件中打开这些文件,但是无法从 gmail 应用程序或直接从文件系统中识别它们……奇怪。

【问题讨论】:

  • 你找到一个确定的答案了吗?我现在也想知道...

标签: android file android-intent mime-types


【解决方案1】:

如果您想在 Gmail 中打开它们,您需要在 intent-filter 中使用 android:host="gmail-ls"android:scheme="file"

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-02-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-01-13
    • 2013-06-12
    相关资源
    最近更新 更多