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

  • Home
  • SEARCH
  • 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 5943183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:21:31+00:00 2026-05-22T16:21:31+00:00

I have a fragment which creates its view inside onCreateView as you’d expect. However

  • 0

I have a fragment which creates its view inside onCreateView as you’d expect. However I want to change the view periodically.

My use case is that the fragment shows some data from a web service. When a user chooses an option from a list (another fragment), this fragment should switch to a progress bar, then once loaded, switch back to the data view.

I could make two fragments – the loading fragment, and the displaying fragment, but it seems that since this is an encapsulated event I’d rather do it all inside the one fragment.

Basically what I am asking, is what is the equivilent of setContentView inside a fragment.

  • 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-05-22T16:21:32+00:00Added an answer on May 22, 2026 at 4:21 pm

    You can use Fragment.getView(). This returns the view of the container which contains the Fragment. On that view, you can call removeAllViews. Then build your new views and add them to the view you got from getView().

    http://developer.android.com/reference/android/app/Fragment.html#getView()

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

Sidebar

Related Questions

I want to use an older code-fragment in my Qt-project, which is using WinSocks.
I have a HTML fragment which contains two anchor tags in various parts of
Lets say you have a fragment of the page which displays the most recent
I have two textures generated using a fragment shader. I want to be able
I have created an eclipse plugin project and a corresponding fragment project which I
I have a view which has an Int column which is nullable (let's call
I have a complex view model which contains a collection of other objects which
I have a Model1.edmx, which has several tables. Now, I do not want all
I have a dialog, which is created from a fragment in my application. When
I have a javascript file that reads another file which may contain javascript fragments

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.