android - 替换 android Intent 选择器对话框

标签 android android-intent

有没有办法替换 Intent 选择器对话框?目前我的应用程序有大量的 Intent 过滤器来接近这个 - 但我想探索其他选项(在这种情况下也只能在 Root设备上工作是一个选项) 我主要想实现这些目标: - 在我的应用程序之前不再有默认的 Intent 选择器 - 注册到所有 Intent

只要接近这些目标中的一个就好了——这里的任何人都可以选择做我想做的事吗?

最佳答案

这是系统支持的。您需要做的就是创建一个具有 Intent.CHOOSERActivity Intent 过滤器。

Android 中默认的定义如下:

<activity android:name="com.android.internal.app.ChooserActivity"
    android:theme="@style/Theme.Holo.Dialog.Alert"
    android:finishOnCloseSystemDialogs="true"
    android:excludeFromRecents="true"
    android:multiprocess="true">
    <intent-filter>
        <action android:name="android.intent.action.CHOOSER" />
        <category android:name="android.intent.category.DEFAULT" />
    </intent-filter>
</activity>

关于android - 替换 android Intent 选择器对话框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22854571/

相关文章:

android - 如何获取小数点后三位的 GPS 经度和纬度值?

javascript - 如何从html页面解析json中的图像

android - 如何使用 Intent 进行 Amazon App Store 搜索并按开发者名称进行过滤?

android - 关于 toast 和 Activity 更改的 WindowManager$BadTokenException

android - 我们可以通过打开下载文件夹吗? Intent ?

android - 每个应用程序一个 Firebase google json 配置文件?

android - Facebook Intent.ACTION_SEND 始终返回 0 作为 resultCode

android - CollapsingToolbarLayout 扩展不适用于 RecyclerView

android - 如何在 viber/instagram 上分享图片+文字?

android - queryIntentActivities 在 android 11 中返回空列表