public class

ProgressDialog

extends AlertDialog
java.lang.Object
   ↳ android.app.Dialog
     ↳ android.app.AlertDialog
       ↳ android.app.ProgressDialog

Class Overview

A dialog showing a progress indicator and an optional text message or view. Only a text message or a view can be used at the same time.

The dialog can be made cancelable on back key press.

The progress range is 0..10000.

Summary

Constants
int STYLE_HORIZONTAL Creates a ProgressDialog with a horizontal progress bar.
int STYLE_SPINNER Creates a ProgressDialog with a ciruclar, spinning progress bar.
[Expand]
Inherited Constants
From interface android.content.DialogInterface
Public Constructors
ProgressDialog(Context context)
ProgressDialog(Context context, int theme)
Public Methods
int getMax()
int getProgress()
int getSecondaryProgress()
void incrementProgressBy(int diff)
void incrementSecondaryProgressBy(int diff)
boolean isIndeterminate()
void onStart()
Called when the dialog is starting.
void setIndeterminate(boolean indeterminate)
void setIndeterminateDrawable(Drawable d)
void setMax(int max)
void setMessage(CharSequence message)
void setProgress(int value)
void setProgressDrawable(Drawable d)
void setProgressStyle(int style)
void setSecondaryProgress(int secondaryProgress)
static ProgressDialog show(Context context, CharSequence title, CharSequence message)
static ProgressDialog show(Context context, CharSequence title, CharSequence message, boolean indeterminate, boolean cancelable)
static ProgressDialog show(Context context, CharSequence title, CharSequence message, boolean indeterminate, boolean cancelable, DialogInterface.OnCancelListener cancelListener)
static ProgressDialog show(Context context, CharSequence title, CharSequence message, boolean indeterminate)
Protected Methods
void onCreate(Bundle savedInstanceState)
Similar to onCreate(Bundle), you should initialized your dialog in this method, including calling setContentView(View).
void onStop()
Called to tell you that you're stopping.
[Expand]
Inherited Methods
From class android.app.AlertDialog
From class android.app.Dialog
From class java.lang.Object
From interface android.content.DialogInterface
From interface android.view.KeyEvent.Callback
From interface android.view.View.OnCreateContextMenuListener
From interface android.view.Window.Callback

Constants

public static final int STYLE_HORIZONTAL

Since: API Level 1

Creates a ProgressDialog with a horizontal progress bar.

Constant Value: 1 (0x00000001)

public static final int STYLE_SPINNER

Since: API Level 1

Creates a ProgressDialog with a ciruclar, spinning progress bar. This is the default.

Constant Value: 0 (0x00000000)

Public Constructors

public ProgressDialog (Context context)

Since: API Level 1

public ProgressDialog (Context context, int theme)

Since: API Level 1

Public Methods

public int getMax ()

Since: API Level 1

public int getProgress ()

Since: API Level 1

public int getSecondaryProgress ()

Since: API Level 1

public void incrementProgressBy (int diff)

Since: API Level 1

public void incrementSecondaryProgressBy (int diff)

Since: API Level 1

public boolean isIndeterminate ()

Since: API Level 1

public void onStart ()

Since: API Level 1

Called when the dialog is starting.

public void setIndeterminate (boolean indeterminate)

Since: API Level 1

public void setIndeterminateDrawable (Drawable d)

Since: API Level 1

public void setMax (int max)

Since: API Level 1

public void setMessage (CharSequence message)

Since: API Level 1

public void setProgress (int value)

Since: API Level 1

public void setProgressDrawable (Drawable d)

Since: API Level 1

public void setProgressStyle (int style)

Since: API Level 1

public void setSecondaryProgress (int secondaryProgress)

Since: API Level 1

public static ProgressDialog show (Context context, CharSequence title, CharSequence message)

Since: API Level 1

public static ProgressDialog show (Context context, CharSequence title, CharSequence message, boolean indeterminate, boolean cancelable)

Since: API Level 1

public static ProgressDialog show (Context context, CharSequence title, CharSequence message, boolean indeterminate, boolean cancelable, DialogInterface.OnCancelListener cancelListener)

Since: API Level 1

public static ProgressDialog show (Context context, CharSequence title, CharSequence message, boolean indeterminate)

Since: API Level 1

Protected Methods

protected void onCreate (Bundle savedInstanceState)

Since: API Level 1

Similar to onCreate(Bundle), you should initialized your dialog in this method, including calling setContentView(View).

Parameters
savedInstanceState If this dialog is being reinitalized after a the hosting activity was previously shut down, holds the result from the most recent call to onSaveInstanceState(), or null if this is the first time.

protected void onStop ()

Since: API Level 1

Called to tell you that you're stopping.