0

I want to share my app's play store link via whats app using android share intent .. i am able to share the url and when we click on it it will redirect to the play store .. but i want to share the links as hyperlink . the sharing content also contain image and other text...

here is my code

intentBuilder = ShareCompat.IntentBuilder.from((Activity) mContext)
                           .setType("image/*")
                           .setText(mContext.getString(R.string.dont_you_wanna_try) +
                                   mContext.getString(R.string.get_auspex_now)+mContext.getString(R.string.auspex_link))
                           .addStream(uri);
Phantômaxx
  • 37,901
  • 21
  • 84
  • 115

1 Answers1

0

You can do this by creating your own intent for sending your image as well as text along with it. You can do this by :

Intent sendIntent = new Intent();
sendIntent.setPackage("com.whatsapp");
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, textToShare);
sendIntent.setType("image/*");
sendIntent.putExtra(Intent.EXTRA_STREAM, uri);
sendIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);

if (sendIntent.resolveActivity(getPackageManager()) == null) {
    startActivity(sendIntent)
} else {
    Toast.makeText(context, "Whatsapp not present in device", Toast.LENGTH_SHORT).show();
}
Abhijeet Kumar
  • 343
  • 2
  • 8