What I want to do is pretty simple. I want app to launch sms app with pre-writen recipient. I made a new Android Application Project and used this code to lauch sms app. It works perfectly until I hit back button. It closes the sms app and then shows a blank screen .
My code looks like:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Intent smsIntent = new Intent(Intent.ACTION_VIEW);
smsIntent.setType("vnd.android-dir/mms-sms");
smsIntent.putExtra("address", "0123456789");
startActivity(smsIntent);
}
I thought it has something to do with a layout and it starts a blank activity (?) at the start of the app so i tried to comment out the setting of a layout //setContentView(R.layout.activity_main);
. It didn't help.
I also tried to override onBackPressed()
which also didn't help.
@Override
public void onBackPressed()
{
finish();
System.exit(0);
}
Is it possible to disable showing of the blank screen ?