Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8174987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T22:36:27+00:00 2026-06-06T22:36:27+00:00

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

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T22:36:30+00:00Added an answer on June 6, 2026 at 10:36 pm

    I suppose It might be useful to someone else, as pointed on website
    http://storkme.org/2011/12/tabs-done-right-viewpager-and-fragments/

    There is already a method which allows you to predefine number of “cached” pages the ViewPager will save from recreating.

    mViewPager.setOffscreenPageLimit(3);
    

    Thanks Jake for reminding me to do a different G search 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Page in question: http://phwsinc.com/our-work/one-rincon-hill.asp In IE6-8, when you click the left-most thumbnail in the
Hi Ive written a simple android application with two xml pages, one has an
I cant seem to link more than one button on a page. The page
I am building one app & this is the setting page(Activity view) of my
Overview: I have two pages in my program; the main page and the other
My current monodroid project is having two problems - one in loading from Assets
Is it possible to add views to a different layout than the one called
I am trying to transfer data from one page to another but some problem
My Android app has two location listeners, one for fine and one for coarse
I'm trying to go from one page to another in an already loaded webview

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.