Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import java.lang.reflect.Method;

import android.webkit.WebSettings;

public class Main {
    /**
     * set page cache
     *
     * @param settings
     * @param capacity
     */
    public static void setWebViewPageCache(WebSettings settings, int capacity) {
        try {
            Method setPageCache = settings.getClass().getMethod("setPageCacheCapacity", new Class[] { int.class });
            setPageCache.invoke(settings, new Object[] { capacity });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}