I have a fragment with one main fragment displayed on it. When I rotate the screen, the activity is beeing recreated. What would be the best way to store the info about currently displayed fragment for screen state restore purposes?
Share
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 can use the method onSaveInstanceState to store values in a bundle:
then you can restore the values in the method onRestoreInstanceState
You can also set an xml attribute on TextViews and EditText called “freezeText” which saves any text that was set.