In my activity, I have a inner class called A extends AsyncTask. I don’t want activity destroys and recreates again when device is rotated. I want it keep running. I have read this link RotationAsync
.They use a static class of AsyncTask. I have declared many variables in my activity, so if i use static class , I can not use variables of activity. Is there another way to do like link above without using static class of AsyncTask? Thanks for your answers. Sorry if my english has some mistakes.
In my activity, I have a inner class called A extends AsyncTask . I
Share
You can prevent your Activity to restart using this settings on the Manifest:
After doing that, you can manage the changes using this code
}
For more info, you can read http://developer.android.com/guide/topics/resources/runtime-changes.html