Skip to content Skip to sidebar Skip to footer

How To Save Asynctask Class Object In Onsaveinstancestate()

is this possible to save AsyncTask class object on rotation and reuse it again. public class MyTask extends AsyncTask { } any good solution.

Solution 1:

is this possible to save AsyncTask class object on rotation and reuse it again.

Use onRetainNonConfigurationInstance() or a retained fragment.

thanks for reply but onRetainNonConfigurationInstance() deprecated after 3.0

That is because they recommend that you use a retained fragment instead. If you are not using fragments, use onRetainNonConfigurationInstance().

Post a Comment for "How To Save Asynctask Class Object In Onsaveinstancestate()"