@SuppressLint("NewApi")
  @Deprecated // Call init() instead and override makeWebView() to customize.
  public void init(
      CordovaWebView webView,
      CordovaWebViewClient webViewClient,
      CordovaChromeClient webChromeClient) {
    LOG.d(TAG, "CordovaActivity.init()");

    if (!preferences.getBoolean("ShowTitle", false)) {
      getWindow().requestFeature(Window.FEATURE_NO_TITLE);
    }

    if (preferences.getBoolean("SetFullscreen", false)) {
      Log.d(
          TAG,
          "The SetFullscreen configuration is deprecated in favor of Fullscreen, and will be removed in a future version.");
      getWindow()
          .setFlags(
              WindowManager.LayoutParams.FLAG_FULLSCREEN,
              WindowManager.LayoutParams.FLAG_FULLSCREEN);
    } else if (preferences.getBoolean("Fullscreen", false)) {
      getWindow()
          .setFlags(
              WindowManager.LayoutParams.FLAG_FULLSCREEN,
              WindowManager.LayoutParams.FLAG_FULLSCREEN);
    } else {
      getWindow()
          .setFlags(
              WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN,
              WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
    }

    appView = webView != null ? webView : makeWebView();
    if (appView.pluginManager == null) {
      appView.init(
          this,
          webViewClient != null ? webViewClient : makeWebViewClient(appView),
          webChromeClient != null ? webChromeClient : makeChromeClient(appView),
          pluginEntries,
          whitelist,
          preferences);
    }

    // TODO: Have the views set this themselves.
    if (preferences.getBoolean("DisallowOverscroll", false)) {
      appView.setOverScrollMode(View.OVER_SCROLL_NEVER);
    }
    createViews();

    // TODO: Make this a preference (CB-6153)
    // Setup the hardware volume controls to handle volume control
    setVolumeControlStream(AudioManager.STREAM_MUSIC);
  }
  /** Load the url into the webview. */
  public void loadUrl(String url) {
    if (appView == null) {
      init();
    }
    this.splashscreenTime = preferences.getInteger("SplashScreenDelay", this.splashscreenTime);
    String splash = preferences.getString("SplashScreen", null);
    if (this.splashscreenTime > 0 && splash != null) {
      this.splashscreen =
          getResources().getIdentifier(splash, "drawable", getClass().getPackage().getName());
      ;
      if (this.splashscreen != 0) {
        this.showSplashScreen(this.splashscreenTime);
      }
    }

    // If keepRunning
    this.keepRunning = preferences.getBoolean("KeepRunning", true);

    // Check if the view is attached to anything
    if (appView.getParent() != null) {
      // Then load the spinner
      this.loadSpinner();
    }
    // Load the correct splashscreen

    if (this.splashscreen != 0) {
      this.appView.loadUrl(url, this.splashscreenTime);
    } else {
      this.appView.loadUrl(url);
    }
  }
 /** Get boolean property for activity. */
 @Deprecated // Call method on preferences directly.
 public boolean getBooleanProperty(String name, boolean defaultValue) {
   return preferences.getBoolean(name, defaultValue);
 }