I'm still trying to find the βrightβ design pattern when working with AsyncTask and screen rotation. I read this commonsware community post that references this code , but the onRetainNonConfigurationInstance method is now deprecated. The magic sentence in the documentation reads: "Ensuring that messages are not processed during the transition to the next activity makes it easier to use with active objects ...", which is a really important part of what this method did. I see no suggestion to use setRetainInstance () to accomplish the same goal.
I also saw messages such as this one , whose number one is really nothing but a bad hack that covers only 90% of use cases (that is, what happens if your task is started and then a phone call arrives, this solution will not work) .
It was suggested that you review the code here for AsyncTask examples, but if I'm not dense, I donβt see that they are used anywhere in the application (when using the search function in google code)
This question has obviously been asked many times, but I have not seen an updated, proper asnwer. If one exists, answer and close it as a duplicate if you want, but at least answer! :)
This is another link that addresses the same, deprecated method.
source share