I have a code to send an SMS. public void sendInvite(ContactRow c) { String message = "Here's the link: https://example.com/i5dLLe"; Intent sendIntent = new Intent(Intent.ACTION_VIEW, Uri.fromParts("sms", c.getPhoneNo(), null)); sendIntent.putExtra("sms_body", message); startActivityForResult(sendIntent, Statics.REQ_CODE_SMS_INVITE); } This returns an error code 21 on Nexus 6P running Marshmallow, but works perfectly on non-Marshmallow devices....
Originally asked by Ankit Aggarwal on Stack Exchange (stackoverflow) (CC BY-SA 4.0).