I have an Activity that starts an AsyncTask. The activity is allowed to show in Portrait or Landscape orientation. When the orientation is
Take a look here for a better understanding of the Android lifecycle: http://developer.android.com/reference/android/app/Activity.html#ActivityLifecycle
You can use onConfigurationChanged() to detect orientation changes in your Activity. You can use the onDestroy() method to determine when your Activity is about to be killed.