title: Android SMS App Opens Within My App
body: <p>In my Android app I need to write a function that will open up the Device's SMS app if it exists.  I have the code below.</p>
  
  <pre><code>String smsText = "Some text for the sms";
  Intent sendIntent = new Intent(Intent.ACTION_VIEW);
  sendIntent.setData(Uri.parse("sms:"));
  sendIntent.putExtra("sms_body", smsText);
  this.startActivity(sendIntent);
  </code></pre>
  
  <p>This code will open up the SMS app however it opens the Compose UI within my app. This means that the user will have to back out of the SMS UI in order to continue using my app. If the user goes to the App Launcher from the Home screen or the App list, it also opens in the same state as it is simply resuming where the app left off.</p>
  
  <p>This was tested on a Samsung Galaxy S4 running Android 4.3</p>
  
  <p>Is there any way to either Completely change contexts and open the SMS app, leaving my app? Or is there a way to close the SMS app after the SMS has been sent?</p>
  
  <p>Any help would be appreciated. This behavior is not what I expected but maybe that is how Android works.</p>
  
  <p>** EDIT **</p>
  
  <p>"It opens the Compose UI within my app" - What I mean by this is that The SMS app's Compose screen is opened. But from any other context it looks like it's my app. So if I hit the home button and go back to the device home screen, then click the app icon, it does not go back to the last place my app was in, but rather it goes to the the SMS Screen again. If I view all open applications, the image of the SMS screen is under my apps name, rather then the SMS app's name.  So from every available resource, it looks as if the SMS app is opening under the name of my app.</p>