load Content to WebView with mimetype and encoding - Android android.webkit

Android examples for android.webkit:WebView

Description

load Content to WebView with mimetype and encoding

Demo Code

import android.content.Context;
import android.webkit.WebView;

public class Main {

  public static void loadContent(Context mContext, WebView webview, String content) {
    final String mimeType = "text/html";
    final String encoding = "UTF-8";

    webview.loadDataWithBaseURL("", content, mimeType, encoding, "");
  }//from  ww w. ja  v  a2 s.c o  m

}

Related Tutorials