Android異常總結—1.異常原因: java.lang.IllegalArgumentException: URI: content://com.android.contacts/con

1.異常原因:

java.lang.IllegalArgumentException: URI: 

 

 

content://com.android.contacts/contacts1/data, calling user: 

 

 

com.credream.contact, calling package:com.credream.contact

at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:144)

at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:114)

at android.content.ContentProviderProxy.bulkQueryInternal

 

 

(ContentProviderNative.java:330)  www.aiwalls.com

at android.content.ContentProviderProxy.query(ContentProviderNative.java:366)

at android.content.ContentResolver.query(ContentResolver.java:245)

at com.credream.contact.ContactTest.testContact(ContactTest.java:56)

at java.lang.reflect.Method.invokeNative(Native Method)

at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)

at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)

at android.test.InstrumentationTestRunner.onStart

 

 

(InstrumentationTestRunner.java:520)

at android.app.Instrumentation$InstrumentationThread.run

 

 

(Instrumentation.java:1447)

————————————-

原因由於:uri=Uri.parse("content://com.android.contacts/contacts"+contactid+"/data");

uri出錯,正確寫的應該是這樣的:

uri=Uri.parse("content://com.android.contacts/contacts/"+contactid+"/data");

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *