package com.hughisaacs2.cordova.plugins.androidscreensaverplugin;

import android.annotation.TargetApi;
import android.service.dreams.DreamService;
import android.webkit.WebView;

@TargetApi(17)
public class ScreensaverProvider extends DreamService {
     @Override
    public void onAttachedToWindow() {
        super.onAttachedToWindow();
        // Allow user touch
        setInteractive(true);
        // Hide system UI
        setFullscreen(true);
        // Set the dream layout
        WebView webView = new WebView(this);
        setContentView(webView);
        webView.loadUrl("file:///android_asset/www/screensaver.html");
    }
}
@@ -176,16 +176,46 @@
 ebView;%0D
+%0Aimport org.apache.cordova.*;%0D
 %0A%0D%0A@Targ
@@ -298,16 +298,42 @@
 erride%0D%0A
+     CordovaWebView cwv;%0D%0A
     publ
@@ -360,24 +360,386 @@
 Window() %7B%0D%0A
+        //super.onAttachedToWindow();%0D%0A        // Allow user touch%0D%0A        //setInteractive(true);%0D%0A        // Hide system UI%0D%0A        //setFullscreen(true);%0D%0A        // Set the dream layout%0D%0A        //WebView webView = new WebView(this);%0D%0A        //setContentView(webView);%0D%0A        //webView.loadUrl(%22file:///android_asset/www/screensaver.html%22);%0D%0A         %0D%0A
         supe
@@ -917,28 +917,18 @@
 ut%0D%0A
-        WebView
+%09%09cwv
  web
-V
+v
 iew 
@@ -925,32 +925,39 @@
 v webview = new 
+Cordova
 WebView(this);%0D%0A
@@ -948,32 +948,73 @@
 WebView(this);%0D%0A
+%09%09org.apache.cordova.Config.init(this);%0D%0A
         setConte
@@ -1012,39 +1012,35 @@
  setContentView(
-webView
+cwv
 );%0D%0A        webV
@@ -1035,23 +1035,19 @@
         
-webView
+cwv
 .loadUrl
@@ -1051,52 +1051,28 @@
 Url(
-%22file:///android_asset/www/screensaver.html%22
+Config.getStartUrl()
 );%0D%0A
@@ -1078,9 +1078,11 @@
 %0A    %7D%0D%0A
-
 %7D
+%0D%0A

Update ScreensaverProvider.java