1

I want to get all MMS and SMS message records at the same time, but mms-sms seems to be an Unrecognized URI which I copy from android's source...

getContentResolver().query(Uri.parse("content://mms-sms"), projections, null, null, null);

Here is the stacktrace, after using code below:

code:

    Uri uri = Uri.parse("content://mms-sms/conversations/");
    Cursor query = contentResolver.query(uri, null, null, null, null);

log:

08-20 18:02:26.696: E/AndroidRuntime(2637): FATAL EXCEPTION: main
08-20 18:02:26.696: E/AndroidRuntime(2637): java.lang.NullPointerException
08-20 18:02:26.696: E/AndroidRuntime(2637):     at android.os.Parcel.readException(Parcel.java:1328)
08-20 18:02:26.696: E/AndroidRuntime(2637):     at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:160)
08-20 18:02:26.696: E/AndroidRuntime(2637):     at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:114)
08-20 18:02:26.696: E/AndroidRuntime(2637):     at android.content.ContentProviderProxy.bulkQueryInternal(ContentProviderNative.java:330)
08-20 18:02:26.696: E/AndroidRuntime(2637):     at android.content.ContentProviderProxy.query(ContentProviderNative.java:366)...
4

1 回答 1

2

将“content://mms-sms/conversations/”更改为“content://mms-sms/conversations”应该可以了。

于 2012-08-24T05:34:08.313 回答