title: Restoring Application State on Phonegap
body: <p>I've develop an Android app with phonegap, my app need to swicthing on the toggle button, then user can close the app and running it in background service. My problem is when I close the app and back to the app again, its back to the initial state with toggle button off. 
  So, My question is how can we saving/restroring app state on android and phonegap?</p>
  
  <p>I've read this <a href="https://stackoverflow.com/questions/14233784/save-restoring-webview-in-an-embedded-phonegap-app">Save &amp; restoring WebView in an embedded PhoneGap app</a> , but I still don't understand about <strong>restoreFromPreferences()</strong> and <strong>saveToPreferences(out)</strong> Can anyone help? </p>
  
  <p>*Sorry for bad english</p>