Hm, that is strange, somehow the activity resolver was run in the contacts
process instead of the system.

On Thu, Nov 20, 2008 at 8:42 AM, Thao <[EMAIL PROTECTED]> wrote:

>
> Hi All,
>
> I try to replace the standard contact application by my custom
> application. Now that I click on the android contact icon, it prompts
> me with launching the standard contact app AND my custom app...That's
> cool...
>
> If I launched my custom app from this, it work very well. But when I
> select the "Use by default for this action" option so I don't have to
> choose next time, then launch my app, the emulator crashes with the
> following message :
>  "The process android.process.acore has stopped unexpectely. Please
> try again"
>
> This is the log I have from logcat :
>
> I/ActivityManager(   65): Starting activity: Intent
> { action=android.intent.action.MAIN categories=
> {android.intent.category.LAUNCHER} flags=0x10000000 comp=
> {com.android.contacts/
> com.android.contacts.DialtactsContactsEntryActivity} }
> D/dalvikvm( 3098): GC freed 1116 objects / 61840 bytes in 60ms
> I/ActivityManager(   65): Displayed activity
> com.android.contacts/.DialtactsContactsEntryActivity: 718 ms
> D/AndroidRuntime( 3098): Shutting down VM
> W/dalvikvm( 3098): threadid=3: thread exiting with uncaught exception
> (group=0x40010e28)
> E/AndroidRuntime( 3098): Uncaught handler: thread main exiting due to
> uncaught exception
> E/AndroidRuntime( 3098): java.lang.SecurityException: Neither user
> 10002 nor current process has
> android.permission.SET_PREFERRED_APPLICATIONS.
> E/AndroidRuntime( 3098):        at android.os.Parcel.readException
> (Parcel.java:1234)
> E/AndroidRuntime( 3098):        at android.os.Parcel.readException
> (Parcel.java:1222)
> E/AndroidRuntime( 3098):        at android.content.pm.IPackageManager
> $Stub$Proxy.addPreferredActivity(IPackageManager.java:1701)
> E/AndroidRuntime( 3098):        at android.app.ApplicationContext
> $ApplicationPackageManager.addPreferredActivity
> (ApplicationContext.java:2259)
> E/AndroidRuntime( 3098):        at
> com.android.internal.app.ResolverActivity.onClick
> (ResolverActivity.java:177)
> E/AndroidRuntime( 3098):        at
> com.android.internal.app.AlertController$AlertParams$3.onItemClick
> (AlertController.java:828)
> E/AndroidRuntime( 3098):        at
> android.widget.AdapterView.performItemClick(AdapterView.java:283)
> E/AndroidRuntime( 3098):        at
> android.widget.ListView.performItemClick(ListView.java:3049)
> E/AndroidRuntime( 3098):        at android.widget.AbsListView
> $PerformClick.run(AbsListView.java:1415)
> E/AndroidRuntime( 3098):        at android.os.Handler.handleCallback
> (Handler.java:542)
> E/AndroidRuntime( 3098):        at android.os.Handler.dispatchMessage
> (Handler.java:86)
> E/AndroidRuntime( 3098):        at android.os.Looper.loop(Looper.java:
> 123)
> E/AndroidRuntime( 3098):        at android.app.ActivityThread.main
> (ActivityThread.java:3742)
> E/AndroidRuntime( 3098):        at
> java.lang.reflect.Method.invokeNative(Native Method)
> E/AndroidRuntime( 3098):        at java.lang.reflect.Method.invoke
> (Method.java:515)
> E/AndroidRuntime( 3098):        at com.android.internal.os.ZygoteInit
> $MethodAndArgsCaller.run(ZygoteInit.java:739)
> E/AndroidRuntime( 3098):        at
> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:497)
> E/AndroidRuntime( 3098):        at dalvik.system.NativeStart.main
> (Native Method)
> I/Process (   65): Sending signal. PID: 3098 SIG: 3
> I/dalvikvm( 3098): threadid=7: reacting to signal 3
> I/dalvikvm( 3098): Wrote stack trace to '/data/anr/traces.txt'
> V/DumpStateReceiver(   65): Running: /system/bin/dumpcrash
> I/DumpStateReceiver(   65): Finished: 1788 bytes read; status 0
> I/DumpStateReceiver(   65): Added state dump to 1 crashes
> I/Process ( 3098): Sending signal. PID: 3098 SIG: 9
> I/ActivityManager(   65): Process android.process.acore (pid 3098) has
> died.
> I/WindowManager(   65): WIN DEATH: Window{433d46d0
> com.android.launcher/com.android.launcher.Launcher}
> I/WindowManager(   65): WIN DEATH: Window{433e78d8
> com.android.contacts/
> com.android.contacts.DialtactsContactsEntryActivity}
> I/ActivityManager(   65): Start proc android.process.acore for
> activity com.android.launcher/.Launcher: pid=3136 uid=10002 gids=
> {3003}
>
>
> - What I can see in those logs, it that the default contact activity
> starts first ( after that its shows me the drop list with the
> choice...) . It seems that this activity raises an exception.
> Is it normal that it start first then prompt with the choice ?
>
> - Seeing this :  java.lang.SecurityException: Neither user 10002 nor
> current process has android.permission.SET_PREFERRED_APPLICATIONS.
>
> So I tried to set the permission in my manifest :
>     <uses-permission
> android:name="android.permission.SET_PREFERRED_APPLICATIONS" />
>
> But it still raising the same error message...
>
> Can someone help please ? Or have a track to move on ? I really have
> no idea of what is happening ...
>
> Thanks
> >
>


-- 
Dianne Hackborn
Android framework engineer
[EMAIL PROTECTED]

Note: please don't send private questions to me, as I don't have time to
provide private support.  All such questions should be posted on public
forums, where I and others can see and answer them.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to