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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T10:35:41+00:00 2026-06-04T10:35:41+00:00

In my application I am using ViewPager from the support library- v4 In main

  • 0

In my application I am using ViewPager from the support library- v4

  1. In main screen I have viewPager which got max 5 Fragment, all fragment belongs to one class ArticlePager

  2. Now in main screen there are list on categories, now the content of the pager is based on that selection,

The problem I am having is, I have used FragmentPagerAdapterwhich stores the Fragment and if the fragment is already exist, It will return the old Fragment without recreating it. That things runs perfectly, but Problem Occurs @ the time of orientation change.

For instance

If there are 5 View normally in every fragment For the given position, but There are also some which contains 2-3 views. Now if I change the orientation on page No. lets say 5 which contains only 3 view inside.

So, by now in every category on Page 5 I’ll got the view containing 3 view, which is not something I want.

In my application each category contains the pagination

Is there any way such that i can destroy and recreate the Fragment on click of category? or any other work around

Thank you

  • 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-04T10:35:42+00:00Added an answer on June 4, 2026 at 10:35 am

    OK thanks to open source I find my solution, FragmentPagerAdapter I have override the method instantiateItem and got the solution.

    This can be easily achieved by FragmentStatePagerAdapter such that it doesn’t store the fragment. It recreate it all the time, but I don’t want that in 100’s of page because of only few pages.

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

Sidebar

Related Questions

I have this application using CAL. All the modules derive from a special class,
I have the following problem. I have a tabbed application implemented using a ViewPager.
I`m trying to build a application using the Fragment/Tabs and Pager from the android
I am using actionbarsherlock library to have action-bar in my application, I am also
I wrote an application using ASP.NET MVC, in this application I have an Index
I have a java-application using JDBC for database interaction. I want to do a
I have made an application using Java/Hibernate/MySQL, but whenever I try running it, it
i have built application using codeigniter, my controller name is userReg , in controller
I am developing application using phonegap in eclipse for android .I have created folder
Hello I'm writing an application that uses the compatibility library and i'm using a

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.