Android Open Source - HelloWebView Browser Utils






From Project

Back to project page HelloWebView.

License

The source code is released under:

Apache License

If you think the Android project HelloWebView listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.mengdd.hellowebview.utils;
//  w ww . j av a  2 s . com
import java.lang.reflect.Method;

import android.content.Intent;
import android.webkit.WebSettings;

public class BrowserUtils {

    public static final String IS_FROM_SELF = "com.mengdd.hellobrowser.IS_FROM_SELF";

    /**
     * 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();
        }
    }

    public static Intent newIntentFromSelf(String action) {
        return newIntentFromSelf().setAction(action);
    }

    public static Intent newIntentFromSelf() {
        Intent intent = new Intent();
        intent.putExtra(IS_FROM_SELF, true);
        return intent;
    }

}




Java Source Code List

com.mengdd.download.DownloadManager.java
com.mengdd.download.Downloader.java
com.mengdd.download.OnDownloadChangedAdapter.java
com.mengdd.download.OnDownloadChangedListener.java
com.mengdd.hellowebview.Constants.java
com.mengdd.hellowebview.MainActivity.java
com.mengdd.hellowebview.utils.BrowserUtils.java
com.mengdd.hellowebview.utils.DeviceUtils.java
com.mengdd.hellowebview.utils.FileUtils.java
com.mengdd.hellowebview.utils.IOUtils.java
com.mengdd.hellowebview.utils.LogUtil.java
com.mengdd.hellowebview.utils.MediaFile.java
com.mengdd.hellowebview.utils.MediaUtil.java
com.mengdd.hellowebview.utils.PreferencesUtils.java
com.mengdd.hellowebview.utils.ReleaseConfig.java