ActionBarSherlock + ViewPager caching more then just prev/next view

Posted by miroslavign on Stack Overflow See other posts from Stack Overflow or by miroslavign
Published on 2012-06-28T00:54:26Z Indexed on 2012/06/29 3:16 UTC
Read the original article Hit count: 234

Filed under:
|

on the page: onCreate called for two tabs each time one tab is selected

there is explained how the ABS(actually ViewPager) is working in order for ViewPager to be able to do a scrolling. It is clear that at least a prev/next page need all to be created at the same time.

Would it be possible to "cache" more than just prev/next Views(Fragments), in a way:

  1. I am on Page 1 and there I have a network call to fetch some data(doing this in Activity, not in Fragment - btw. is this OK?)

  2. switch to Page 2, and then

  3. switch to Page 3, and then

  4. switch to Page 1 = Here my page is recreated (using some caching though, BUT, I do not need any recreation if possible)

So, it would be nice to cache all the pages. How to accomplish this If possible in current version (4), or this would be some new feature?

Or even better question, how to postpond/disable destroying of views?

© Stack Overflow or respective owner

Related posts about android

Related posts about android-viewpager