0

I need to make it so that when a button is pressed, the system application for sending SMS is launched. But I don't know how to do that and I haven't found any information about it. Is there any way to do this? Please, help me!

I found a way to launch another application using the code below, it works for youtube for example, but I don't know the package that contains the system application for sending sms

messageIcon.setOnClickListener(view -> {
            Intent launchIntent = getPackageManager().getLaunchIntentForPackage("");
            if (launchIntent != null) {
                startActivity(launchIntent);
            } else {
                Toast.makeText(MainActivity.this, "Произошла ошибка...", Toast.LENGTH_LONG).show();
            }
        });
kerbermeister
  • 2,985
  • 3
  • 11
  • 30
nnn
  • 23
  • 4

1 Answers1

0

Found that here

Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_APP_MESSAGING);
startActivity(intent);