Android 非启动器的意图过滤器 activity
Android intent filter for a non-launcher activity
我正在尝试为我的 activity(非启动器)添加一个特殊扩展的 intent 过滤器。但是在文件管理器中,例如 TotalCommander 和其他文件 - 这些文件仍然没有与我的应用程序相关联,并且 Android 不建议我的应用程序在我尝试从文件管理器打开这些文件时打开它们。但是当我将我的 intent-filter - 移动到启动器 activity - 一切开始正常工作。所以我想知道 - 扩展的意图过滤器应该只添加到在清单中声明为启动器的 activity 吗?谢谢
这是我的意图过滤器
<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:scheme="file"/>
<data android:mimeType="*/*"/>
<data android:pathPattern=".*\.myext"/>
</intent-filter>
只需添加 host
<data android:host="*" />
If a host is not specified for the filter, the port attribute and all
the path attributes are ignored.
了解更多here.
我正在尝试为我的 activity(非启动器)添加一个特殊扩展的 intent 过滤器。但是在文件管理器中,例如 TotalCommander 和其他文件 - 这些文件仍然没有与我的应用程序相关联,并且 Android 不建议我的应用程序在我尝试从文件管理器打开这些文件时打开它们。但是当我将我的 intent-filter - 移动到启动器 activity - 一切开始正常工作。所以我想知道 - 扩展的意图过滤器应该只添加到在清单中声明为启动器的 activity 吗?谢谢
这是我的意图过滤器
<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:scheme="file"/>
<data android:mimeType="*/*"/>
<data android:pathPattern=".*\.myext"/>
</intent-filter>
只需添加 host
<data android:host="*" />
If a host is not specified for the filter, the port attribute and all the path attributes are ignored.
了解更多here.