Android - html5 problem with localstorage

While rendering the HTML5 page in android, where I used localStorage HTML5.

localStorage["temp"] = "test";

For the above line, this gives an error: TypeError: "null" is not an object (evaluation "localStorage [" temp "] =" test "') .

(It works fine in chrome or firefox browsers, it is written in html5 storage , it supports android 2.0 +)

+5
source share
1 answer

Try setting this in your webview settings:

yourWebViewObject.getSettings().setDomStorageEnabled(true);
+6
source

All Articles