android - LocalStorage not persistent with Phonegap -


i'd keep data on user's mobile localstorage. app build phonegap.

function check_connection() {     var id = window.localstorage.getitem("id");     if(id != null)         // code     console.log(id); } 

when code after window.localstorage.setitem("id", "value");, "value", if exit application , run again, "null".

document.addeventlistener("deviceready", main, true); function main() {     check_connection(); } 

the exit seems clear localstorage object.

any idea ?

edit : data persistent when quit app pressing button, when kill app recent apps, data cleared. problem ?

are calling somewhere window.localstorage.clear();?


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -