2

I would create an sms and save it into sms inbox.

I've tried using this:

ContentValues values = new ContentValues();
values.put("address", phoneNumber);
values.put("date", time);
values.put("body", message);
values.put("type", 1);
values.put("read", 1);
context.getContentResolver().insert(Uri.parse("content://sms"), values);

This work on android 4.0.x, 4.1.x and 4.2.x, but don't work on android 4.4.

How can i set my message into the default message application?

Thank you to all.

user3253955
  • 433
  • 1
  • 8
  • 17
  • Certainly we can, just like this: https://stackoverflow.com/questions/27697282/android-kitkat-api-19-how-to-write-messages-in-sms-content-provider-without – jp1017 Mar 02 '17 at 07:04

1 Answers1

4

How can i set my message into the default message application?

You cannot modify the SMS inbox unless your app is the user's chosen SMS client on Android 4.4+.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491