Device Orientation

Rusty

Well-Known Member
Licensed User
Longtime User
Is there a way to detect when the user rotates the (Android) device from landscape to portrait and back. I would like to change the size of objects based upon the x/y dimensions of the device and not necessarily keep them the same and in the process change the number of rows/columns of buttons, for example.
Further, when the device is rotated, I understand that the activity is destroyed and a new one created. You implied there was an easy way to retain values from the previous activity so the user doesn't have to start over again. What method is this?
 
Last edited:

alfcen

Well-Known Member
Licensed User
Longtime User
Upvote 0

Rusty

Well-Known Member
Licensed User
Longtime User
Thanks to both Erel and AlfCen.
I followed AlfCen's advice and declared my data variables within the Process globals. Then with the edittext field changed event stored them there. When the activity resumes, i reload the edittext from the stored values.
Works like a charm!:)
 
Upvote 0
Top