Hyperlink Not working Android OS 5 and Above

118 Views Asked by At

In My Application opening Gmail via Intent. I have added Hyperlink Intent Extra text it's not working Android OS 5 and above but it's working fine OS 4.3

Please suggest me what is the problem. Please refer the code below.

Note: Direct link [https://www.google.co.in/] working fine all Android OS.

Code:

Intent sharingIntent = new Intent(Intent.ACTION_SEND);
sharingIntent.setType("text/html");
sharingIntent.putExtra(Intent.EXTRA_TEXT, Html.fromHtml("<a href=https://www.google.co.in/>Google</a>");
startActivity(Intent.createChooser(sharingIntent,"Share using"));
1

There are 1 best solutions below

0
Omkar On

try below code

 Intent share = new Intent(android.content.Intent.ACTION_SEND);
    share.setType("text/plain");
    share.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);


    share.putExtra(Intent.EXTRA_SUBJECT, "Google");
    share.putExtra(Intent.EXTRA_TEXT, "https://www.google.co.in");

    startActivity(Intent.createChooser(share, "Share link!"));