show Text In WebView - Android android.webkit

Android examples for android.webkit:WebView

Description

show Text In WebView

Demo Code

import android.webkit.WebView;

public class Main{

    public static void showTextInWebView(WebView view, String string) {
        String prefix = "<body style=\"text-align:justify;color:#FFFFFF\">";
        String postfix = "</body>";
        view.loadDataWithBaseURL("", prefix + string + postfix,
                "text/html", "UTF-8", "");
        view.setBackgroundColor(0x00000000);
    }// w  w  w.  j  a v  a2s .c  om

}

Related Tutorials