I have an Activity that starts an AsyncTask. The activity is allowed to show in Portrait or Landscape orientation. When the orientation is
you can use isFinishing() method , to check if the activity is going to be killed or onDestroy() method just called due to change in orientation
@Override
protected void onDestroy() {
super.onDestroy();
if(isFinishing()){
Log.i("DEBUG", "App will Terminate ");
}else{
Log.i("DEBUG", "Orientation changed");
}
}