android - 使用我的 android 应用程序打开特定文件
问题描述
当我单击扩展名为“play”(someFileName.play)的文件时,我试图打开我的 android 应用程序。
我的问题是,我单击哪种文件并不重要,它提供了使用我的应用程序打开它的选项。
这是我的“Manifest.xml”:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.play">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="false"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:launchMode="singleTask"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<!-- custom file start -->
<intent-filter
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name">
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.EDIT" />
<category android:name="android.intent.category.DEFAULT" />
<!-- change custom file extension -->
<data android:mimeType="*/*" />
<data android:host="*" />
<data android:pathPattern=".*\\.play" />
</intent-filter>
<!-- custom file end -->
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
</application>
</manifest>
需要帮助修复它,请帮助。
解决方案
尝试更改为:
<!-- change custom file extension -->
<data android:mimeType="*/*"
android:host="*"
android:pathPattern=".*\\.play" />
推荐阅读
- typescript - 基于传递的布尔参数的返回类型
- bigcommerce - Bigcommerce 是否可以将所有 bigcommerce 文件拉到本地环境中,以便我可以在本地测试更改?
- c++ - 为什么我们不能将 char 分配给字符串?
- hamiltonian-cycle - 使用 LKH-2,是否可以提取所有哈密顿循环?
- git - 在重新调整其分支后重新打开关闭的拉取请求
- php - Doctrine Query Builder 和 Where With 或 Where
- java - 转换集合
列出 > 在特定条件下使用 stream() - java - DatePickerFragment.newInstance() 无法从静态上下文 android studio 中引用
- laravel - 目标 [...] 在构建 [...] 时不可实例化
- string - 我们如何在 Bigquery 表中将数字转换为 12 小时时间格式