I am writing a backup and restore demo. And it work well in Android 4. But it failed to restore sms in Android 6.0.
I request sms permission by code already. But I can't insert sms by Resolver
.
Here is my code.
// if the sms not exist, insert it
if (cursor.getCount() == 0) {
context.getContentResolver().insert(
Uri.parse(CONTENT_SMS), values);
}
private static final String CONTENT_SMS = "content://sms";
It haven't throw any exception when insert sms.