show Text In WebView - Android User Interface

Android examples for User Interface:WebView

Description

show Text In WebView

Demo Code


//package com.java2s;
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);
    }/*from ww  w . j a v  a 2  s  .c  o m*/
}

Related Tutorials