我正在使用创建一个新帐户AccountManager
,它适用于 android 2.3+,但对于 android 2.1,它在尝试查看联系人详细信息时会导致手机的地址簿崩溃。
帐户定义如下:
type: com.example.android.authenticators.ABCAuthenticator.account
name: Contacts ABC
我在尝试打开联系人的详细活动时看到的崩溃(不是在我的应用程序上,它工作正常,而是在摩托罗拉 2.1 的本机联系人应用程序上)是:
V/ContactsListActivity( 1667): onListItemClick :Uri = content://com.android.contacts/contacts/lookup/0r42-29292929/42
I/ActivityManager( 1017): Starting activity: Intent { act=android.intent.action.VIEW dat=content://com.android.contacts/contacts/lookup/0r42-29292929/42 cmp=com.android.contacts/.ViewContactActivity }
D/AndroidRuntime( 1667): Shutting down VM
W/dalvikvm( 1667): threadid=1: thread exiting with uncaught exception (group=0x4001ac68)
E/AndroidRuntime( 1667): Uncaught handler: thread main exiting due to uncaught exception
E/AndroidRuntime( 1667): java.lang.IllegalStateException: Couldn't find authenticator for specific account type
E/AndroidRuntime( 1667): at com.android.contacts.model.Sources.findAuthenticator(Sources.java:253)
E/AndroidRuntime( 1667): at com.android.contacts.model.Sources.queryAccounts(Sources.java:193)
E/AndroidRuntime( 1667): at com.android.contacts.model.Sources.<init>(Sources.java:109)
E/AndroidRuntime( 1667): at com.android.contacts.model.Sources.getInstance(Sources.java:93)
E/AndroidRuntime( 1667): at com.android.contacts.ViewContactActivity.buildEntries(ViewContactActivity.java:1372)
E/AndroidRuntime( 1667): at com.android.contacts.ViewContactActivity.bindData(ViewContactActivity.java:681)
E/AndroidRuntime( 1667): at com.android.contacts.ViewContactActivity.considerBindData(ViewContactActivity.java:674)
E/AndroidRuntime( 1667): at com.android.contacts.ViewContactActivity.onQueryComplete(ViewContactActivity.java:542)
E/AndroidRuntime( 1667): at com.android.contacts.util.NotifyingAsyncQueryHandler.onQueryComplete(NotifyingAsyncQueryHandler.java:65)
E/AndroidRuntime( 1667): at android.content.AsyncQueryHandler.handleMessage(AsyncQueryHandler.java:408)
E/AndroidRuntime( 1667): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 1667): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 1667): at android.app.ActivityThread.main(ActivityThread.java:4695)
E/AndroidRuntime( 1667): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 1667): at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime( 1667): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
E/AndroidRuntime( 1667): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:663)
E/AndroidRuntime( 1667): at dalvik.system.NativeStart.main(Native Method)
I/Process ( 1017): Sending signal. PID: 1667 SIG: 3
I/dalvikvm( 1667): threadid=3: reacting to signal 3
似乎它试图找到身份验证器,但没有找到它......但是为什么呢?Android 2.1 的身份验证器的名称/类型是否有任何限制?有任何想法吗?