I am trying a lot but it is not wroking. Here's my code:
public class SchofferStr extends Activity {
String summary = "<html><body>You scored <b>192</b> points.</body></html>";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.menu);
WebView webview = new WebView(this);
setContentView(webview);
webview.loadData(summary, "text/html", "utf-8");
}
}
the summary string i have is a lengthy htmlformatted table. But problem is this code is not even working for this simple html formated string. What is it that im doing wrong? Please help, im stuck.
Try:
webview.loadDataWithBaseURL(null, summary, "text/html", "UTF-8", null);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With