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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T14:55:24+00:00 2026-05-20T14:55:24+00:00

Is there a way to swap out a view at runtime? Here’s my goal:

  • 0

Is there a way to “swap” out a view at runtime? Here’s my goal: I want to display an animated, indeterminate ProgressBar view until my image is loaded. Is there a way to do this easily, without having to do a bunch of crazy stuff? Is there a way I can get the resource ID of the ProgressBar spinner animation and simply reuse that?

  • 1 1 Answer
  • 1 View
  • 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-20T14:55:25+00:00Added an answer on May 20, 2026 at 2:55 pm

    Yes. I tend to make a FrameLayout which contains both an ImageView and a ProgressBar. In onCreate() I do imageView.setVisibility(View.INVISIBLE) and then once the image loads I do:

    progress.setVisibility(View.INVISIBLE);
    imageView.setVisibility(View.VISIBLE);
    

    In terms of the threading you should as always use AsyncTask. This is easily the most complicated part of the process, although still quite manageable. Check out this answer for a full code listing.

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

Sidebar

Related Questions

I want to swap both references, is there a nice way make such a
Is there a way to tell Windows that it shouldn't swap out a particular
Is there a way to tell Linux that it shouldn't swap out a particular
I am just curious if there is a way to swap the two stings
Is there an easy way to switch out a movieClip for another dynamically loaded
I have a View Controller that is swapping UIView objects in and out. There
I am looking for a way to swap out the content of a portion
I'd like to be able to swap out data templates at runtime, but without
Basically I'm trying to figure out the best way to swap a model and
I'm wondering what is the best way to swap out two panels on the

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.