Possible Duplicate:
Android: Temporarily disable orientation changes in an Activity
Me testing in Samsung Galaxy tab. In that i have made two layout folder for both ORIENTATION_LANDSCAPE and ORIENTATION_PORTRAIT with specific layout xml in it.
In that layout i have a button and on clicking it start a progress dialog (doing some stuff using AsyncTask, after that going to new intent)
But when the device is rotated when the progress dialog is working, that dialog and AsyncTask stop and new layout is loaded. If i understood correctly, I think the onCreate
is called when device is rotated
How i can block calling onCreate while rotating device when My AsyncTask start?
IN SHOT
How i can lock Orientation of a device by code, for example Lock Orientation on a button click
Thank you