Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
318 views
in Technique[技术] by (71.8m points)

android - SGS-3 bug related to SMS conversations list?

This issue was reported several times, but still not resolved yet. I read all messages/thread which somehow related to this topic either in Samsung's developers site or in StackOverflow

Let me again describe whole problem just in few words:

  1. Developers used to get list of SMS conversations through simple query like:

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

    or something like this. Key point here's URI address: content://mms-sms/conversations

  2. Everyone knows that it's unofficial and one's doing it on his own risk - see proof link here

  3. But, critical point here's a simple fact this code doesn't work properly only in Samsung Galaxy S3 and some models of Galaxy Tab 2. It produces NullPointerException with stacktrace:

    java.lang.NullPointerException at android.os.Parcel.readException(Parcel.java:1431) at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:188) at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:140) at android.content.ContentProviderProxy.query(ContentProviderNative.java:366) at android.content.ContentResolver.query(ContentResolver.java:372) at android.content.ContentResolver.query(ContentResolver.java:315)

In all other devices of the rest of the World/Universe it works well! Strange, huh?

I know answers like: hey dude, it's your problem, since presence/correctness of aforementioned URI doesn't guaranteed, nevertheless, does someone has more productive idea?

I have already posted question to Samsung's developers through their forum.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

In the end I've figured how to overcome aforementioned issue (I am not sure that it's bug, but anyway it looks like a bug).

List of conversations can be retrieved through this query:

Uri.parse("content://mms-sms/conversations?simple=true"); 
Cursor cursor = context.getApplicationContext().getContentResolver().query(uri, null, null, null, null);

Keypoint here's URI content://mms-sms/conversations?simple=true.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...