In my application I use only WebView for loading index.html where running all app logic(html’s and javascript).
Where screen orientation changed, all data from JavaScript variables disappear.
How I can save all data when orientation changed?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You have to catch orientation changes and handle them by yourself, because by default the Activity gets recreated (and your WebView will be reloaded).
Add the
android:configChangesattribute to your Activity in the AndroidManifest.xmlAnd override the
onConfigurationChangedmethod in your Activity class.Also have a look here: Activity restart on rotation Android