Android SMS Send shareViaSms(Context context, String subject, String text)

Here you can find the source of shareViaSms(Context context, String subject, String text)

Description

share Via Sms

Declaration

public static void shareViaSms(Context context, String subject,
            String text) 

Method Source Code

//package com.java2s;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;

public class Main {
    public static void shareViaSms(Context context, String subject,
            String text) {//w  ww.java2  s  . co m
        Intent intent = new Intent();
        intent.setType("text/plain");
        intent.setData(Uri.parse("sms:"));
        intent.setAction(Intent.ACTION_VIEW);
        intent.putExtra("sms_body", text);
        context.startActivity(Intent.createChooser(intent, "Share via SMS"));
    }
}

Related

  1. sendSms(@Nonnull Context context, @CheckForNull String number, @Nullable String text)
  2. getMultipleSmsJoinOn()