Method Calls On Android Screen Rotation
I have an android project in which I had to put a checkbox and a button such that if the checkbox is checked then the button is enabled, otherwise it is not enabled. Firstly I impl
Solution 1:
When you rotate the screen, the activity is basically recreated. Some state information may be automatically preserved, but you should become more familiar with the overall activity lifecycle to understand the subtle differences.
Solution 2:
In addition to Jerry's answer, to get around the issue quickly, you can simply make boolean member variables in your activity for each of your check boxes. These should then persist through orientation change.
Jerry is right, make sure you know about the Android Lifecycle.
Solution 3:
Add this line of code in your activity inside your manifest file.
android:configChanges="orientation"
Post a Comment for "Method Calls On Android Screen Rotation"