Example usage for android.webkit WebSettings setNavDump

List of usage examples for android.webkit WebSettings setNavDump

Introduction

In this page you can find the example usage for android.webkit WebSettings setNavDump.

Prototype

@SystemApi
@Deprecated
public abstract void setNavDump(boolean enabled);

Source Link

Document

Enables dumping the pages navigation cache to a text file.

Usage

From source file:org.apache.cordova.CordovaWebView.java

/**
 * Initialize webview./*from w w  w  .j a va  2s. c  o m*/
 */
@SuppressWarnings("deprecation")
@SuppressLint("NewApi")
private void setup() {

    this.setInitialScale(0);
    this.setVerticalScrollBarEnabled(false);
    this.requestFocusFromTouch();

    // Enable JavaScript
    WebSettings settings = this.getSettings();
    settings.setJavaScriptEnabled(true);
    settings.setJavaScriptCanOpenWindowsAutomatically(true);
    settings.setLayoutAlgorithm(LayoutAlgorithm.NORMAL);

    //Set the nav dump for HTC 2.x devices (disabling for ICS/Jellybean)
    if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.HONEYCOMB)
        settings.setNavDump(true);

    //Jellybean rightfully tried to lock this down. Too bad they didn't give us a whitelist
    //while we do this
    if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1)
        settings.setAllowUniversalAccessFromFileURLs(true);
    // Enable database
    settings.setDatabaseEnabled(true);
    String databasePath = this.cordova.getActivity().getApplicationContext()
            .getDir("database", Context.MODE_PRIVATE).getPath();
    settings.setDatabasePath(databasePath);

    // Enable DOM storage
    settings.setDomStorageEnabled(true);

    // Enable built-in geolocation
    settings.setGeolocationEnabled(true);

    //Start up the plugin manager
    try {
        this.pluginManager = new PluginManager(this, this.cordova);
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    exposeJsInterface();
}