0

This is my WebView code :

String mimeType = "text/html";
String encoding = "utf-8";
String htmlText = itemJob.getJobDesc();

String text = "<html><head>"
        + "<style type=\"text/css\">@font-face {font-family: MyFont;src: url(\"file:///android_asset/fonts/custom.otf\")}body{font-family: MyFont;color: #0b0b0b;text-align:left;font-size:15px;margin-left:0px}"
        + "</style></head>"
        + "<body>"
        + htmlText
        + "</body></html>";
webView.loadDataWithBaseURL(null, text, mimeType, encoding, null);

When I click on Links inside the WebView, nothing happens! How to open links in the Browser?

Zoe stands with Ukraine
  • 25,310
  • 18
  • 114
  • 149
Sainita
  • 282
  • 1
  • 11

1 Answers1

0

use this.. it is perfectly worked for me.

Hopefully this is working for you

wvDesciption.loadData("<p align='justify'>" + mCouresubModel.getDescription() + "</p>", "text/html; charset=UTF-8", null);
Amit Joshi
  • 26
  • 4