有没有办法替换 Intent 选择器对话框?目前我的应用程序有大量的 Intent 过滤器来接近这个 - 但我想探索其他选项(在这种情况下也只能在 Root设备上工作是一个选项) 我主要想实现这些目标: - 在我的应用程序之前不再有默认的 Intent 选择器 - 注册到所有 Intent
只要接近这些目标中的一个就好了——这里的任何人都可以选择做我想做的事吗?
最佳答案
这是系统支持的。您需要做的就是创建一个具有 Intent.CHOOSER
的 Activity
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/