Sunday, 6 February 2022

When Samsung “Dual Messenger” is enabled, how to launch the second messenger programmatically?

Dual Messenger is a feature on Samsung Android phones

[Screenshot from Samsung A70 (Android 9]

For example I can launch the first copy of WhatsApp using intent by calling package name "com.whatsapp".

        Intent waIntent = new Intent(Intent.ACTION_SEND);
        waIntent.setType("text/plain");
        String text = "THIS IS MY TEXT";

        PackageInfo info=pm.getPackageInfo("com.whatsapp", PackageManager.GET_META_DATA);

        waIntent.setPackage("com.whatsapp");

        waIntent.putExtra(Intent.EXTRA_TEXT, text);
        startActivity(Intent.createChooser(waIntent, "Share with"));

What would be the package name or other Intent options required to launch the second WhatsApp?



from When Samsung “Dual Messenger” is enabled, how to launch the second messenger programmatically?

No comments:

Post a Comment