Hello,
I would like to do the same but with the dialer. It is not working
and I get the same log as kristianlm.
W/KeyCharacterMap( 622): Using default keymap: /system/usr/keychars/
qwerty.kcm.bin
I/PackageManager( 579): Result set changed, dropping preferred
activity for Intent { action=android.intent.action.CALL_BUTTON
flags=0x10000000 } type null
I/ActivityManager( 579): Starting activity: Intent
{ action=android.intent.action.CALL_BUTTON flags=0x10000000
comp={android/com.android.internal.app.ResolverActivity} }
Thanks
On 7 jan, 17:56, kristianlm <[email protected]> wrote:
> Hi folks!
>
> I'm trying to have my home-screen application register itself as the
> default home-screen so the user is not prompted with the
> IntentResolver's list of all the available home-activities.
>
> this is my code:
>
> private void makePreferred() {
> PackageManager pm = getPackageManager();
> IntentFilter f = new
> IntentFilter("android.intent.action.MAIN");
> f.addCategory("android.intent.category.HOME");
> f.addCategory("android.intent.category.DEFAULT");
> ComponentName cn = new
> ComponentName("com.example.android.home",
> "com.example.android.home.Home");
> pm.addPreferredActivity(f, IntentFilter.MATCH_CATEGORY_EMPTY,
> null,
> cn);
>
> I have the android.permission.SET_PREFERRED_APPLICATIONS set in the
> manifest. After executing the code above, the logs claim things have
> been added like expected (same logs as when I tick off "Make default"
> from IntentResolver's list). However, when I proceed by clicking home,
> the list still shows up and the logs say:
>
> INFO/PackageManager(52): Result set changed, droppingpreferredactivityfor
> Intent { act=android.intent.action.MAIN cat=
> [android.intent.category.HOME] flg=0x10200000 } type null
>
> So it seems the resolver deletes the default entry. Am I doing
> something wrong, or is this a security measure? What are the ideas
> behind this?
>
> Thanks folks!
> Kris
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en