意图过滤器与Android:优先级设置 [英] intent-filter with android:priority setting

查看:516
本文介绍了意图过滤器与Android:优先级设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我测试的意图过滤器机器人:优先级=0和意图过滤器机器人:优先=20 android.intent.category.HOME 。我列出以下信息,

I test the intent-filter android:priority="0" and intent-filter android:priority="20" by android.intent.category.HOME. I list the information below,

    <activity android:name=".TestHomeActivity"
              android:label="@string/app_name">
        <intent-filter android:priority="0">
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.HOME" />
            <category android:name="android.intent.category.LAUNCHER" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>

在完成系统启动,它总是会弹出一个对话框(ResolveActiivty)对于选择这个意图preferred活动......

When finishing system booting, it always pops up a dialog (ResolveActiivty) for choose preferred activity for this intent...

任何人都可以帮助吗?这是错误的使用了安卓?优先

Can anyone can help this? is it error usage for android:priority?

谢谢!

推荐答案

我还没有真正看到安卓优先正考虑在系统解决意向。我只是想在一个意图过滤器,我使用的设置优先级,但系统仍然给我的分辨率弹出的对话框中,不管是什么值设置我的意图过滤器的优先级。

I haven't actually seen android:priority being taken into account when the system is resolving intents. I just tried setting a priority on an intent-filter that I use, but the system still gave me the resolution popup dialog, no matter what value I set my intent-filter's priority to.

我猜你只需要选择您要使用(也就是你)在主页屏幕上的活动,并选择使用默认......复选框。

I guess you'll just have to select the home screen activity you want to use (i.e. yours) and select the "Use by default..." checkbox.

这篇关于意图过滤器与Android:优先级设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆