android.app
Class ProgressDialog
java.lang.Object
android.app.Dialog
android.app.AlertDialog
android.app.ProgressDialog
- All Implemented Interfaces:
- DialogInterface, KeyEvent.Callback, View.OnCreateContextMenuListener, Window.Callback
public class ProgressDialog
- extends AlertDialog
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.
|
Field Summary |
static int |
STYLE_HORIZONTAL
Creates a ProgressDialog with a horizontal progress bar. |
static int |
STYLE_SPINNER
Creates a ProgressDialog with a ciruclar, spinning progress
bar. |
|
Method Summary |
int |
getMax()
|
int |
getProgress()
|
int |
getSecondaryProgress()
|
void |
incrementProgressBy(int diff)
|
void |
incrementSecondaryProgressBy(int diff)
|
boolean |
isIndeterminate()
|
protected void |
onCreate(Bundle savedInstanceState)
Similar to Activity.onCreate(android.os.Bundle), you should initialized your dialog
in this method, including calling Dialog.setContentView(int). |
void |
onStart()
Called when the dialog is starting. |
protected void |
onStop()
Called to tell you that you're stopping. |
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)
|
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)
|
| Methods inherited from class android.app.AlertDialog |
onKeyDown, onKeyUp, setButton, setButton, setButton2, setButton2, setButton3, setButton3, setCustomTitle, setIcon, setIcon, setInverseBackgroundForced, setTitle, setView |
| Methods inherited from class android.app.Dialog |
addContentView, cancel, closeOptionsMenu, dismiss, dispatchKeyEvent, dispatchOnCreate, dispatchTouchEvent, dispatchTrackballEvent, findViewById, getContext, getCurrentFocus, getLayoutInflater, getOwnerActivity, getVolumeControlStream, getWindow, hide, isShowing, onContentChanged, onContextItemSelected, onContextMenuClosed, onCreateContextMenu, onCreateOptionsMenu, onCreatePanelMenu, onCreatePanelView, onKeyMultiple, onMenuItemSelected, onMenuOpened, onOptionsItemSelected, onOptionsMenuClosed, onPanelClosed, onPrepareOptionsMenu, onPreparePanel, onRestoreInstanceState, onSaveInstanceState, onSearchRequested, onTouchEvent, onTrackballEvent, onWindowAttributesChanged, onWindowFocusChanged, openContextMenu, openOptionsMenu, registerForContextMenu, requestWindowFeature, setCancelable, setCanceledOnTouchOutside, setCancelMessage, setContentView, setContentView, setContentView, setDismissMessage, setFeatureDrawable, setFeatureDrawableAlpha, setFeatureDrawableResource, setFeatureDrawableUri, setOnCancelListener, setOnDismissListener, setOnKeyListener, setOwnerActivity, setTitle, setVolumeControlStream, show, takeKeyEvents, unregisterForContextMenu |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
STYLE_SPINNER
public static final int STYLE_SPINNER
- Creates a ProgressDialog with a ciruclar, spinning progress
bar. This is the default.
- See Also:
- Constant Field Values
STYLE_HORIZONTAL
public static final int STYLE_HORIZONTAL
- Creates a ProgressDialog with a horizontal progress bar.
- See Also:
- Constant Field Values
ProgressDialog
public ProgressDialog(Context context)
ProgressDialog
public ProgressDialog(Context context,
int theme)
show
public static ProgressDialog show(Context context,
CharSequence title,
CharSequence message)
show
public static ProgressDialog show(Context context,
CharSequence title,
CharSequence message,
boolean indeterminate)
show
public static ProgressDialog show(Context context,
CharSequence title,
CharSequence message,
boolean indeterminate,
boolean cancelable)
show
public static ProgressDialog show(Context context,
CharSequence title,
CharSequence message,
boolean indeterminate,
boolean cancelable,
DialogInterface.OnCancelListener cancelListener)
onCreate
protected void onCreate(Bundle savedInstanceState)
- Description copied from class:
Dialog
- Similar to
Activity.onCreate(android.os.Bundle), you should initialized your dialog
in this method, including calling Dialog.setContentView(int).
- Overrides:
onCreate in class AlertDialog
- 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 Dialog.onSaveInstanceState(), or null if this
is the first time.
onStart
public void onStart()
- Description copied from class:
Dialog
- Called when the dialog is starting.
- Overrides:
onStart in class Dialog
onStop
protected void onStop()
- Description copied from class:
Dialog
- Called to tell you that you're stopping.
- Overrides:
onStop in class Dialog
setProgress
public void setProgress(int value)
setSecondaryProgress
public void setSecondaryProgress(int secondaryProgress)
getProgress
public int getProgress()
getSecondaryProgress
public int getSecondaryProgress()
getMax
public int getMax()
setMax
public void setMax(int max)
incrementProgressBy
public void incrementProgressBy(int diff)
incrementSecondaryProgressBy
public void incrementSecondaryProgressBy(int diff)
setProgressDrawable
public void setProgressDrawable(Drawable d)
setIndeterminateDrawable
public void setIndeterminateDrawable(Drawable d)
setIndeterminate
public void setIndeterminate(boolean indeterminate)
isIndeterminate
public boolean isIndeterminate()
setMessage
public void setMessage(CharSequence message)
- Overrides:
setMessage in class AlertDialog
setProgressStyle
public void setProgressStyle(int style)
Please submit a feedback, bug or feature