From 21fc67b358312e3f86d3d30806586b9fd4f026ca Mon Sep 17 00:00:00 2001 From: Greg Rynkowski Date: Wed, 18 May 2016 12:27:12 +0100 Subject: [PATCH] Enable WebView's local storage on Android Problem: cocos2d::experimental::ui::WebView' local storage wasn't working on Android. On iOS worked fine. Solution: Enable local storage of android.webkit.WebView in Android. References: https://developer.android.com/reference/android/webkit/WebSettings.html http://stackoverflow.com/questions/5899087/android-webview-localstorage --- .../android/java/src/org/cocos2dx/lib/Cocos2dxWebView.java | 1 + 1 file changed, 1 insertion(+) diff --git a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxWebView.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxWebView.java index 3a2229746a..a592dd50f9 100755 --- a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxWebView.java +++ b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxWebView.java @@ -54,6 +54,7 @@ public class Cocos2dxWebView extends WebView { this.getSettings().setSupportZoom(false); + this.getSettings().setDomStorageEnabled(true); this.getSettings().setJavaScriptEnabled(true); // `searchBoxJavaBridge_` has big security risk. http://jvn.jp/en/jp/JVN53768697