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 7884099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:42:30+00:00 2026-06-03T04:42:30+00:00

As topic states I’m trying to implement swipable tabs using Fragments and ActionBar. I’ve

  • 0

As topic states I’m trying to implement swipable tabs using Fragments and ActionBar. I’ve iplemented it successfully using ActionBarSherlock and code from examples with the TabsAdapter class (subclass to FragmentPageAdapter). Some of the fragments should be able to show a new tab in the same tab spor, and this is where the problem arises. I really can’t figure out how to replace a fragment in the pager with a new one. I’ve googled and tried out a lot of stuff.

I can replacie the fragment in the internal collection holding the fragments classes inside the FragmentPageAdapter, thus making the new Fragment available to the getItem method but that doesn’t do it as I can’t figure out how to update the pager to show the new Fragment. Even after switching to another Tab and going back I still get the old Fragment which I suppose is being cached somewhere by the pager. So is there a way to notify an update to the pager?

Maybe I should just forget using FragmentPageAdapter ? In that case what is the right way to get all this functionallity happen?

P.S. If you want to see my code let me know, but it’s basicly the same as in the examples and the problem is more general I think

  • 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-03T04:42:31+00:00Added an answer on June 3, 2026 at 4:42 am

    When you use a ViewPager it keeps the visible page/fragment in memory in addition to pages/fragments that you can navigate to. In addition to this, if the ViewPager is using a FragmentPagerApdapter it keeps the views in memory for the life of the activity.

    I answered a similar post to yours above removing a fragment which can be found here. Your case is an extension of this, removing and then adding something else.

    https://stackoverflow.com/a/10399127/629555

    Basically, you need to use a FragmentStatePagerAdapter, override the getItemPosition method to return PagerAdapter.POSITION_NONE and make sure you call .notifyDataSetChanged(); on your adapter when you want it changed.

    The answer to the link above covers this in much more detail and provides a code example.

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

Sidebar

Related Questions

like the topic states - i'm trying to update a NSManagedObject in another thread.
As the topic states, using a Rich Text Editor with a PopUpManager makes typing
As the topic states: How to convert from an Hermite curve into Bezier curve?
topic.php $id = isset($_GET['id']) ? intval($_GET['id']) : 0; $query = mysql_query(SELECT * FROM topics
Topic is self explanatory. I found xaml code to do it for an Expander,
The topic says it all. Using Compact Framework C# I'm tiling (order/sequence is important)
As the topic states - is there any technology that would let me write
As topic states. How can I put 1 extra day to the selected user
As the topic states, sometimes these issues conflict. For example... In this case, the
Simply what the topic states, what's a memory efficient way to compute a sha256

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.