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>
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
?
Thanks!
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:priority
is only used on OrderedBroadcast intents, not the order of resolution for non-ordered broadcasts. Users select the default activity for a given action, which is why the dialog pops up. So, yes, you are using priority
incorrectly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With