purplecabbage/phonegap-plugins — Issue #59: Android childbrowser setJavaScriptEnabled not working
Author: georgehenderson
Created: 2012-01-25 17:56:21+00:00
State: open

When loading a local file in the childbrowser I noticed that javascript is disabled, although setJavaScriptEnabled is passed true in the java file. I was able to remedy this by adding

// added WebSettings
import android.webkit.WebSettings;

// replaced this
webview = new WebView(ctx);
webview.getSettings().setJavaScriptEnabled(true);

// with this
WebSettings settings = webview.getSettings();
settings.setJavaScriptEnabled(true);

Should webview.getSettings() work without importing WebSettings?