Possible Duplicate:
Don’t want activity to be destroyed/created when phone is rotated
I'm trying to write a program that needs smooth orientation sensor samples as the phone is rotated all around. Every time the orientation of the phone is changed, it interrupts the data and freezes the program while the layout changes. How can I lock it in one orientation (landscape or portrait, it doesn't matter)?
I assume it has something to do with android:layout
in the xml file, but I can't find anything online.
Simplest and one of ways to do this would be having android:screenOrientation="portrait|landscape"
property for the <activity>
tag in your AndroidManifest.xml
file.
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