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