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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T19:38:18+00:00 2026-06-16T19:38:18+00:00

Whenever I open my application for the first time, there are three fragments displayed

  • 0

Whenever I open my application for the first time, there are three fragments displayed correctly in 3 containers I have in my xml file. Upon clicking a tab on the action bar, one of the containers’ fragment is swapped for another.

The Problem

Whenever I open the app, swap to the second tab, use the back arrow to exit the app, then reopen the app and re-select the second tab, the fragment is blank. Nothing appears, and the same problem occurs with the third tab also. Why aren’t the second and third fragments being displayed?

  • 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-16T19:38:19+00:00Added an answer on June 16, 2026 at 7:38 pm

    I solved it by using a public static boolean started value in each of my fragments. In each fragment’s class, in the onCreateView() I set started = true; and in the onDestroyView() I set started = false;

    In the onTabSelected() method of my main activity, I read this boolean value, and if it is true, I attach the fragment back to its container, but if it is false, I create a new instance of the particular fragment and add it to the container.

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

Sidebar

Related Questions

We have an application using the IBM Informix driver. Whenever we try to open
i have a tabforms in my application and whenever i open the multiple forms
Whenever I try to open a file with ifstream, it compiles fine, but will
I have a few different things open in the terminal whenever I'm developing --
I'm trying to write my first Azure application with Visual Studio 2008. Whenever I
I have 3 pdf file for 1 chapter like pdf_chapter_1_page_1.pdf,pdf_chapter_1_page_2.pdf,pdf_chapter_1_page_3.pdf. In first chapter we
I got a windows form application with a timer. Whenever I open a fullscreen
Whenever my MVC/EF 4.1 code first web application tries to access the data base
In my asp.net web application, i have used liter control for displaying HTML data.Whenever
In my c# windows application whenever I open my solution in visual studio 2008,

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.