I did a simple application with 2 buttons (start and exit) and an empty TextView. If i push the start button, a TextView will be update. My problem is that if i rotate the device, my layout will restart (if start was pushed, the TextView will become empty again. Why?
It because activity recreate after screen rotate. Simple fix is adding android:id
to your TextView
at xml.
Android automatically destroys the activity and recreates it adapting it to the new orientation of the screen when the device is rotated.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With