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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:39:40+00:00 2026-06-17T20:39:40+00:00

Dialogs @ Android Developer says to avoid ProgressDialog to indicate loading, and instead, to

  • 0

Dialogs @ Android Developer says to avoid ProgressDialog to indicate loading, and instead, to put an activity indicator right in the layout.

Progress & Activity @ Android Developer discusses activity indicators, but doesn’t name the classes used. I’ve had no luck searching for Android classes with names like ActivityBar, ActivityCircle, or ActivityIndicator.

Where can I find documentation (tutorials, examples, or API documentation) on Android’s support for including activity indicators right in my layout, avoiding a ProgressDialog?

Update: full.stack.ex pointed me the right answer.

First, include the following code in the Activity’s onCreate() method before invoking setContentView():

requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);

Next, just before loading (e.g. firing up an AsyncTaskLoader), use this call to make the spinner appear:

setProgressBarIndeterminateVisibility(true);

Finally, after the load is completed, hide the spinner again:

MainActivity.this.setProgressBarIndeterminateVisibility(false);

Bingo! No ProgressDialog required. Making the spinner visible seems to slow down loading considerably in the emulator (it takes minutes instead of seconds), but not on my actual phone. I’m not sure if there’s any way to make the spinner use fewer CPU cycles.

  • 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-17T20:39:41+00:00Added an answer on June 17, 2026 at 8:39 pm

    It’s not really obvious from the documentation that there’s a window feature for that.

    It’s a built-in progress indicator:

    Activity.requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    

    developer.android.com/reference/android/app/Activity.html#requestWindowFeature(int)

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

Sidebar

Related Questions

I'm following this guide to add an actionbar SearchView widget to my activity: http://developer.android.com/training/search/setup.html
I've created a searchable activity as described here: http://developer.android.com/guide/topics/search/search-dialog.html . When the user presses
I used the instructions given Here: http://developer.android.com/guide/topics/ui/dialogs.html#AddingAList to create a List in a dialog.
As a android base developer, i have always been using progressdialog for android. So
What is the purpose of onSearchRequested()? I am referring to here: http://developer.android.com/reference/android/app/Activity.html#onSearchRequested%28%29 The following
I'm following http://developer.android.com/guide/topics/search/search-dialog.html to create a searchable activity for my app. SearchableActivity.java package com.xxxx.xx;
Based on the code here, http://developer.android.com/guide/topics/ui/dialogs.html#CustomDialog . I am successfully able to create a
Ok so I've read the Custom Dialog explanation on the And Dev website http://developer.android.com/guide/topics/ui/dialogs.html#CustomDialog
I'm trying to add a Search-ActionView to my application (as explained here http://developer.android.com/guide/topics/search/search-dialog.html#UsingSearchWidget ).
I have a class that extends android.app.Dialog, the layout is done in an xml

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.