This post has been closed due to a previous questions answer satisfying this question.
This post has been closed due to a previous questions answer satisfying this question.
You don't need to know what the default messaging app is in order to launch it. All you need it to send this intent:
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_APP_MESSAGING);
intent.setFlags(Intent.FLAG_FROM_BACKGROUND | Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
Or if you actually want to start a text message to a specific phone#:
Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.parse("sms:5551234567"));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
Obviously, replace "5551234567" with the actual phone number