public static void launchSmsIntent(final Activity activity,String number,String text){
  Log.i(LOG_TAG,"Launch SMS intent to " + number);
  Uri smsUri=Uri.parse("smsto:" + number);
  Intent smsIntent=new Intent(Intent.ACTION_SENDTO,smsUri);
  smsIntent.putExtra("sms_body",text);
  PackageManager smspackageManager=activity.getPackageManager();
  List<ResolveInfo> smsresolveInfos=smspackageManager.queryIntentActivities(smsIntent,0);
  if (smsresolveInfos.size() > 0) {
    activity.startActivity(smsIntent);
  }
}

public static void launchSmsIntent ( final Activity activity , String number , String text ) { Log . i ( LOG_TAG , "Launch SMS intent to " + number ) ; Uri smsUri = Uri . parse ( "smsto:" + number ) ; Intent smsIntent = new Intent ( Intent . ACTION_SENDTO , smsUri ) ; smsIntent . putExtra ( "sms_body" , text ) ; PackageManager smspackageManager = activity . getPackageManager ( ) ; List < ResolveInfo > smsresolveInfos = smspackageManager . queryIntentActivities ( smsIntent , 0 ) ; if ( smsresolveInfos . size ( ) > 0 ) { activity . startActivity ( smsIntent ) ; } }
launch a sms intent if the device is capable .
