how do you keep the activity from restarting when the screen rotates or when then user slides the keyboard on the phone? Is this possible? Is there a work around or something? All relevant answers are appreciated.
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 do this by declaring a specific attribute in your
activityelement in yourmanifest.xml. The element in question is calledandroid:configChanges, and you need to register the string value oforientation.From the documentation:
So doing this will cause your
Activityto not restart, and will also callback toonConfigurationChanged()so that you can handle the change yourself.