How to make Custom popup look when send Intent in android

Viewed 38

I`m new to android, I want to look like this custom popup intent

this is what I get my popup intent

here my question is how to add custom image and text in above popup when i try to share something via intent send.

this is my code what should I change here?

Intent sendIntent = new Intent();
            sendIntent.setAction(Intent.ACTION_SEND);
            sendIntent.putExtra(Intent.EXTRA_TEXT,
                    "Intall COC!!"+"https://play.google.com/store/apps/details?id=com.supercell.clashofclans");
            sendIntent.setType("text/plain");
            startActivity(sendIntent);
1 Answers

Check your android version it's only supported start at android 11

use below code

Intent shareIntent = new Intent(Intent.ACTION_SEND);
            shareIntent.setType("text/plain");
            shareIntent.putExtra(Intent.EXTRA_SUBJECT, "Here you can make custom title");
            String shareMessage= "\nhere you can make custom message";
            shareMessage = shareMessage + "Intall CoC!!\"+\"https://play.google.com/store/apps/details?id=com.supercell.clashofclans" + BuildConfig.APPLICATION_ID +"\n";
            shareIntent.putExtra(Intent.EXTRA_TEXT, shareMessage);
            startActivity(Intent.createChooser(shareIntent, "choose one"));
Related