gpt4 book ai didi

android - 如何为文件浏览器应用程序 "myfiles"注册备用 mp3 查看器?

转载 作者:行者123 更新时间:2023-11-29 16:16:53 24 4
gpt4 key购买 nike

我正在创建一个 mp3tag 编辑器并希望它通过 android-buildin-filebrowser“myfiles”(com.sec.android.app.myfiles/com.sec.android.app.myfiles.MainActivity) 开始。

当我选择一个 mp3 文件时,我得到一个 Activity 选择器,它为我提供了两个程序来执行该文件。不幸的是,我自己的程序不在提供的选择之列。

但是,如果我使用外部 android-filebrowser OI File Manager它为我提供了一个选择器其中包括我自己的应用程序。

我的问题:我必须如何在 list 中注册我的 Activity ,以便“myfiles”可以启动它?

我的应用是这样注册的:

    <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="media.mp3"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk android:minSdkVersion="7" />

<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:label="@string/app_name"
android:name=".Mp3TagEditorActivity" >
<intent-filter >
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.EDIT" />
<category android:name="android.intent.category.VIEW" />
<data android:mimeType="audio/mpeg" />

</intent-filter>
</activity>
</application>
</manifest>

最佳答案

I am creating an mp3tag editor and want it to get started via the android-buildin-filebrowser "myfiles".

Android 操作系统中没有“android-buildin-filebrowser 'myfiles'”。您可能会想到某些特定设备上附带的文件浏览器。

My question: how do i have to register my actrivity in the manifest so that "myfiles" can launch it?

要明确回答这个问题,您必须联系“myfiles”的作者。

My app is registered like this:

你的 <intent-filter>是相当错误的。

首先,EDITVIEW是 Action ,不是类别。

其次,它匹配您的 <intent-filter> 的唯一方式如果LAUNCHER包含类别,这对于 EDIT 来说是极不可能的或 VIEW Action 。

如果您希望此 Activity 同时出现在主屏幕的启动器中响应VIEWEDIT Action ,你需要这样的东西:

        <activity
android:label="@string/app_name"
android:name=".Mp3TagEditorActivity" >
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter >
<action android:name="android.intent.action.EDIT" />
<action android:name="android.intent.action.VIEW" />
<data android:mimeType="audio/mpeg" />
</intent-filter>
</activity>

两个独立的<intent-filter>元素是逻辑或 - 任何 Intent匹配第一个第二个的将匹配此 Activity 。

关于android - 如何为文件浏览器应用程序 "myfiles"注册备用 mp3 查看器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8701507/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com