How to make a clickable link when we share a link with image on a WhatsApp status from app android studio

Viewed 74

Here is the code

  StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
    StrictMode.setVmPolicy(builder.build());

    File file = new File(this.getExternalCacheDir(), File.separator + "/" + "Wallpaper Bazaar" + ".jpeg");
    BitmapDrawable bitmapDrawable = (BitmapDrawable) itemImage.getDrawable();
    Bitmap bitmap = bitmapDrawable.getBitmap();
    try {

        FileOutputStream outputStream = new FileOutputStream(file);
        bitmap.compress(Bitmap.CompressFormat.JPEG, 100, outputStream);
        outputStream.flush();
        outputStream.close();
        Intent intent = new Intent(android.content.Intent.ACTION_SEND);
        intent.setType("image/*");
        intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(file));
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        intent.putExtra(Intent.EXTRA_TEXT, "That's Awesome...\uD83D\uDC40 \n\n Install Now!☺☺ \n\n" + "https://play.google.com/store/apps/details?id=" + this.getPackageName());
        startActivity(Intent.createChooser(intent, "Share Image from " + this.getString(R.string.app_name)));

    } catch (Exception e) {
        e.printStackTrace();
    }

We are using this code to share the link with the image it's working correctly however when we share the link with the image on the WhatsApp status, the link work like a text, so our question is how to make a clickable link when we share a link with image on WhatsApp status. please help me to figure out the solution of this problem.

0 Answers
Related