Only want to block orientation until all the data is loaded in my view. So I thought about the following code but it doesn\'t work.
private class task extends As
Probably a bug, but maybe a better way would be to either lock your orientation so you dont need to worry about the activity being created... OR better yet.
Use this in your manifest for the activity:
android:configChanges="orientation|screenSize|screenLayout"
Then your activity isn't recreated on rotate (also as of HoneyComb/3.0 Activities aren't re-created on rotate).
Just override the:
onConfigurationChanged(Configuration newConfig){
//Handle new orientation
}
Then you don't need to confuse the user why there phone has stopped rotating during an operation.
Also worth looking at Robospice if you want lifecyled async tasks.