    public void onAttachedToWindow() {
        super.onAttachedToWindow();
        setContentView(R.layout.main);
        lightsOut(); 
        final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
        final String url = prefs.getString("url", "file:///android_asset/default.html");
        final boolean interactive = prefs.getBoolean("interactive", false);
        Log.v("WebViewDream", String.format("loading %s in %s mode",
                url, interactive ? "interactive" : "noninteractive"));
        setInteractive(interactive);
        WebView webview = (WebView) findViewById(R.id.webview);
        webview.setWebViewClient(new LinkLauncher());
        WebSettings webSettings = webview.getSettings();
        webSettings.setJavaScriptEnabled(true);
        webview.loadUrl(url);
    }

    public void onAttachedToWindow() {
        super.onAttachedToWindow();
        setContentView(R.layout.main);
        setFullscreen(true);
        final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
        final String url = prefs.getString("url", "file:///android_asset/default.html");
        final boolean interactive = prefs.getBoolean("interactive", false);
        Log.v("WebViewDream", String.format("loading %s in %s mode",
                url, interactive ? "interactive" : "noninteractive"));
        setInteractive(interactive);
        WebView webview = (WebView) findViewById(R.id.webview);
        webview.setWebViewClient(new LinkLauncher());
        WebSettings webSettings = webview.getSettings();
        webSettings.setJavaScriptEnabled(true);
        webview.loadUrl(url);
    }
