I am wanting my app to, on a button click, launch the user's default texting app. The intention is not to have the user send a message, but to view their current text conversations, therefore I don't want it to launch the SMS app's "New Message" activity but instead the main app's activity itself.
If I do the following:
Intent sendIntent = new Intent(Intent.ACTION_VIEW);
sendIntent.setData(Uri.parse("sms:"));
context.startActivity(sendIntent);
Then this is launched, instead I want it to launch the main part of the app, not this new message screen:
Navigate to and open Settings, and then tap Apps. Tap Choose default apps, and then tap SMS app.
Since the introduction of Android 4.4, Google allows only one app to run as default SMS app. Only your selected app is authorized to manage the SMS database entirely. The concept of one single default SMS app was introduced by Google and represents a change of the operating system that we are not able to influence.
Open the Messages app . Settings. Turn off All "Default settings" notifications.
String defaultApplication = Settings.Secure.getString(getContentResolver(), "sms_default_application");
PackageManager pm = getPackageManager();
Intent intent = pm.getLaunchIntentForPackage(defaultApplication );
if (intent != null) {
startActivity(intent);
}
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_DEFAULT);
intent.setType("vnd.android-dir/mms-sms");
startActivity(intent);
This may be what you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With