为了账号安全,请及时绑定邮箱和手机立即绑定

在Android中注册新文件类型

在Android中注册新文件类型

至尊宝的传说 2019-11-29 09:55:25
我想在Android上编写一个简单的STL(几何数据文件)查看器应用程序,但无法识别系统的格式。我在我的应用清单文件中写了这个:<intent-filter>    <action android:name="android.intent.action.VIEW" />    <action android:name="android.intent.action.EDIT" />    <action android:name="android.intent.action.PICK" />    <category android:name="android.intent.category.DEFAULT" />    <data android:scheme="http" />    <data android:pathPattern=".*\\.stl" />    <data android:mimeType="application/sla" />    <data android:host="*" /></intent-filter>但是,当我启动浏览器并下载一些示例STL文件时,下载被中断,并且我报告系统的数据文件类型未知。我没有真正的Android设备,所以我只使用一个仿真器,并且在开发中我在MonoDroid上使用C#(但老实说我不认为这是问题所在)。我该如何解决这个问题?
查看完整描述

3 回答

?
四季花海

TA贡献1811条经验 获得超5个赞

我尝试了其他解决方案,这是唯一对我有用的解决方案:


<intent-filter

    android:icon="@drawable/icon"

    android:label="Armro File"

    android:priority="1" >

    <action android:name="android.intent.action.VIEW" />


    <category android:name="android.intent.category.DEFAULT" />

    <category android:name="android.intent.category.BROWSABLE" />


    <data android:scheme="http" />

    <data android:scheme="https" />

    <data android:scheme="ftp" />

    <data android:scheme="file" />

    <data android:host="*" />

    <data android:mimeType="*/*" />

    <data android:pathPattern=".*\\.myowntype" />

</intent-filter>

为什么其他的都不起作用?


查看完整回答
反对 回复 2019-11-29
  • 3 回答
  • 0 关注
  • 670 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信