I have a ViewPager
with 9 Fragments
in it. Each Fragment
got some amount of data loaded from Web. When I rotate screen or open another activity via Intent
with all 9 fragments loaded they all call OnSaveInstance
method, where each fragment data is serialized for future fragment recreation. It cause a little lags and message
Skipped 41 frames! The application may be doing too much work on its main thread.
So OnSaveInstance
in running on UI thread right? And serialization of 9 Fragments makes it skipping frames.
How can I avoid this laggs? Is there a way to do OnSaveInstance
code in background?