How to create loading dialogs in Android?

AndroidDialogProgress Bar

Android Problem Overview


Those dark spinning progress dialogs in the Amazon and Engadget apps - are those standard in Android?

Android Solutions


Solution 1 - Android

It's a ProgressDialog, with setIndeterminate(true).

From http://developer.android.com/guide/topics/ui/dialogs.html#ProgressDialog

ProgressDialog dialog = ProgressDialog.show(MyActivity.this, "", 
                    "Loading. Please wait...", true);

An indeterminate progress bar doesn't actually show a bar, it shows a spinning activity circle thing. I'm sure you know what I mean :)

Solution 2 - Android

Today things have changed a little.

Now we avoid use ProgressDialog to show spinning progress:

enter image description here

If you want to put in your app a spinning progress you should use an Activity indicators:

http://developer.android.com/design/building-blocks/progress.html#activity


Update

Thay have renamed the component to Progress Indicators now.

The new link for reference is: https://material.io/components/progress-indicators/android

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionEnoView Question on Stackoverflow
Solution 1 - AndroidsynicView Answer on Stackoverflow
Solution 2 - AndroidRafael MiceliView Answer on Stackoverflow