get WebView Scale - Android android.webkit

Android examples for android.webkit:WebView

Description

get WebView Scale

Demo Code

import android.app.Activity;
import android.util.Log;
import android.view.Display;
import android.webkit.WebSettings;
import android.webkit.WebView;

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();
    }//from  w ww .j  a va2  s. com

}

Related Tutorials