I have fragment which shows data in GridView. Data are downloaded from internet in AsyncTask. If user asks for more – more data will be downloaded and put into grid.
I would like to keep already downloaded data during orientation change, now it is always downloaded form internet.
What is the best way to keep already downloaded data in fragment during orientation change?
Thanks!
you can use setRetainInstance() function for this.
Here is a full sample code for the same: Sample Code