Question

I want to access the content provider for sms in Android version 4.4 onwards. I know about the following way

Uri sms = Uri.parse("content://sms/");

This doesn't seem to work for 4.4. Can anyone help and tell me the right path?

Was it helpful?

Solution

Try below code Ekta:

Cursor c = cr.query(Telephony.Sms.Inbox.CONTENT_URI, // Official CONTENT_URI from docs
                      new String[] { Telephony.Sms.Inbox.BODY }, // Select body text
                      null,
                      null,
                      Telephony.Sms.Inbox.DEFAULT_SORT_ORDER // Default sort order);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top