Possible duplicate:
Android: temporarily disable orientation changes in Activity
Me testing on the Samsung Galaxy tab. In this, I created two layout folders for ORIENTATION_LANDSCAPE and ORIENTATION_PORTRAIT with a specific xml layout. In this layout, I have a button, and when I click on it, a progress dialog box starts up (performing some actions using AsyncTask, after that a new intention occurs)
But when the device rotates, when the run dialog works, this dialog and AsyncTask stop and the new layout are loaded . If I understand correctly, I think that onCreateis called when the device is spinning. How can I block the onCreate call while the device is spinning, when My AsyncTask starts?
IN SHOT
How can I lock the orientation of a device by code, for example, "Lock orientation" when I click Thank you
source
share