Send SMS by startActivity with Intent.ACTION_SENDTO

Here is a example by calling startActivity() with Intent.ACTION_SENDTO. Android default SMS app will be started to send SMS with pre-defined text and number.

remark: change "xxxxxxxx" to the number of the phone to receive SMS.

        Uri uri = Uri.parse("smsto:xxxxxxxx");  
Intent intent = new Intent(Intent.ACTION_SENDTO, uri);
intent.putExtra("sms_body", "SMS text");
startActivity(intent);




0 Response to "Send SMS by startActivity with Intent.ACTION_SENDTO"

Posting Komentar