WebView is one of the features that are often used in Android application development. I have ever meet trouble that my hyperlink work in my emulator that user marshmallow and didn’t work in my smartphone that use pie operating system.
Firest way i load my html code just like that,
1 |
webView.loadData(HTMLCODE, "text/html; charset=utf-8", "utf-8"); |
that code work only to show the web data, but my hyperlink so ambyar, not run at all. I thinking and try try try try………………. until mumet ndase. And finaly i got the trick, what is that? yes i use loadDataWithBaseURL.
1 |
webView.loadDataWithBaseURL(null, HTMLCODE, "text/html; charset=utf-8", "utf-8", null); |
the simple trick that make me dumbfounded. wkwk