load Content Adaptive Screen using WebView - Android User Interface

Android examples for User Interface:WebView

Description

load Content Adaptive Screen using WebView

Demo Code


//package com.java2s;

import android.content.Context;

import android.webkit.WebSettings.LayoutAlgorithm;

import android.webkit.WebView;

public class Main {
    public static void loadContentAdaptiveScreen(Context mContext,
            WebView webview, String content) {
        final String mimeType = "text/html";
        final String encoding = "UTF-8";
        webview.getSettings().setLayoutAlgorithm(
                LayoutAlgorithm.SINGLE_COLUMN);

        webview.loadDataWithBaseURL("", content, mimeType, encoding, "");
    }//www  . ja v  a  2s  .  co  m
}

Related Tutorials