Home

Published

- 1 min read

Share application “link” in Android

img of Share application “link” in Android

The solution for this is noted below

Solution

   try {
    Intent shareIntent = new Intent(Intent.ACTION_SEND);
    shareIntent.setType("text/plain");
    shareIntent.putExtra(Intent.EXTRA_SUBJECT, "My application name");
    String shareMessage= "\nLet me recommend you this application\n\n";
    shareMessage = shareMessage + "https://play.google.com/store/apps/details?id=" + BuildConfig.APPLICATION_ID +"\n\n";
    shareIntent.putExtra(Intent.EXTRA_TEXT, shareMessage);
    startActivity(Intent.createChooser(shareIntent, "choose one"));
} catch(Exception e) {
    //e.toString();
}

Try other methods by searching on the site. That is if this doesn’t work