【发布时间】:2015-04-14 22:39:27
【问题描述】:
我正在尝试在我正在编写的应用程序中打开一个 zip 文件,但是当我在 Galaxy S5 上的“我的文件”中浏览该文件时,“我的文件”会解压缩文件而不是打开该应用程序。
如果我将扩展名更改为 .upgradezip,应用程序打开并传递给它的指定文件没有问题,但我的文件似乎完全忽略了意图过滤器并尝试解压缩文件,特别是当扩展名是 .拉链
其他设备,包括 LG 平板电脑,可以使用我的应用程序打开 .zip 文件,使用与 Galaxy S5 上相同的清单。
想法?这是我清单中的相关信息,我暂时支持 zip 和 upgradezip,但所有设备都可以使用 zip。
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:host="" android:scheme="content" android:pathPattern=".*\\.upgradezip" android:mimeType="application/octet-stream"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:host="" android:scheme="file" android:mimeType="*/*" android:pathPattern=".*\\.upgradezip"/>
</intent-filter>
<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:mimeType="application/octet-stream" />
</intent-filter>
<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:mimeType="application/zip" />
</intent-filter>
【问题讨论】:
标签: java android android-intent intentfilter galaxy