Android Trick - Using intent to Send SMS and come back

Damon
In Android we can use Intent to send SMS or calling phone number and something else.

System will start default ( Or show a list of apps who can accept this intent ) app. Then if you want to come back to your own application after that you will need this .

Intent sendIntent = new Intent(Intent.ACTION_SENDTO); 
sendIntent.setData(Uri.parse("sms:" + number));
sendIntent.putExtra("sms_body", smsContent); 
sendIntent.putExtra("exit_on_sent", true);
startActivity(sendIntent);

Not sure whether it also works for the other Intents. 

Comments

Popular posts from this blog

A wired issue of MediaPlayer on Android

How to add pre-receive hook in GitLab

Problem when using Jackson json parser in Android.