get WebView Scale - Android User Interface

Android examples for User Interface:WebView Zoom

Description

get WebView Scale

Demo Code


//package com.java2s;
import android.app.Activity;

import android.view.Display;

public class Main {
    public static int getWebViewScale(Activity act) {
        Display display = act.getWindowManager().getDefaultDisplay();
        int width = display.getWidth();
        Double val = Double.valueOf(width) / Double.valueOf(1000);
        val = val * 100d;
        return val.intValue();
    }/* w w  w.  j  a  v a 2s. c o  m*/
}

Related Tutorials