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
  • 27,060
  • 21
  • 118
  • 148
Sainita
  • 332
  • 1
  • 4
  • 16

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
  • 36
  • 4