I have an Activity that start some asynctasks. I want these tasks to stop, when my Activity is destroyed "normally" (like calling finish() / the user pressing the back button / etc.), but continue running when the user only rotates the device.
Canceling these tasks, and handling the rotation works just fine, I just can't combine the two.
So is there a way to tell during the "onDestroy()" callback, that the Activity is destroyed bec开发者_StackOverflowause of a configurational change (rotation), or because of some other cause (back button e.g.)?
You can call isChangingConfigurations()
on your Activity
.
精彩评论