ProgressDialog
open classProgressDialog: AlertDialog
| kotlin.Any | |||
| ↳ | android.app.Dialog | ||
| ↳ | android.app.AlertDialog | ||
| ↳ | android.app.ProgressDialog | ||
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 to max.
Summary
| Constants | |
|---|---|
| static Int | 
            
             Creates a ProgressDialog with a horizontal progress bar.  | 
        
| static Int | 
            
             Creates a ProgressDialog with a circular, spinning progress bar.  | 
        
| Inherited constants | |
|---|---|
| Public constructors | |
|---|---|
            ProgressDialog(context: Context!)Creates a Progress dialog.  | 
        |
            ProgressDialog(context: Context!, theme: Int)Creates a Progress dialog.  | 
        |
| Public methods | |
|---|---|
| open Int | 
            getMax()Gets the maximum allowed progress value.  | 
        
| open Int | 
            
             Gets the current progress.  | 
        
| open Int | 
            
             Gets the current secondary progress.  | 
        
| open Unit | 
            incrementProgressBy(diff: Int)Increments the current progress value.  | 
        
| open Unit | 
            incrementSecondaryProgressBy(diff: Int)Increments the current secondary progress value.  | 
        
| open Boolean | 
            
             Whether this ProgressDialog is in indeterminate mode.  | 
        
| open Unit | 
            onStart() | 
        
| open Unit | 
            setIndeterminate(indeterminate: Boolean)Change the indeterminate mode for this ProgressDialog.  | 
        
| open Unit | 
            
             Sets the drawable to be used to display the indeterminate progress value.  | 
        
| open Unit | 
            
             Sets the maximum allowed progress value.  | 
        
| open Unit | 
            setMessage(message: CharSequence!) | 
        
| open Unit | 
            setProgress(value: Int)Sets the current progress.  | 
        
| open Unit | 
            
             Sets the drawable to be used to display the progress value.  | 
        
| open Unit | 
            setProgressNumberFormat(format: String!)Change the format of the small text showing current and maximum units of progress.  | 
        
| open Unit | 
            setProgressPercentFormat(format: NumberFormat!)Change the format of the small text showing the percentage of progress.  | 
        
| open Unit | 
            setProgressStyle(style: Int)Sets the style of this ProgressDialog, either   | 
        
| open Unit | 
            setSecondaryProgress(secondaryProgress: Int)Sets the secondary progress.  | 
        
| open static ProgressDialog! | 
            show(context: Context!, title: CharSequence!, message: CharSequence!)Creates and shows a ProgressDialog.  | 
        
| open static ProgressDialog! | 
            show(context: Context!, title: CharSequence!, message: CharSequence!, indeterminate: Boolean)Creates and shows a ProgressDialog.  | 
        
| open static ProgressDialog! | 
            show(context: Context!, title: CharSequence!, message: CharSequence!, indeterminate: Boolean, cancelable: Boolean)Creates and shows a ProgressDialog.  | 
        
| open static ProgressDialog! | 
            show(context: Context!, title: CharSequence!, message: CharSequence!, indeterminate: Boolean, cancelable: Boolean, cancelListener: DialogInterface.OnCancelListener!)Creates and shows a ProgressDialog.  | 
        
| Protected methods | |
|---|---|
| open Unit | |
| open Unit | 
            onStop() | 
        
| Inherited functions | |
|---|---|
Constants
STYLE_HORIZONTAL
static valSTYLE_HORIZONTAL: Int
Deprecated: Deprecated in Java.
Creates a ProgressDialog with a horizontal progress bar.
Value: 1STYLE_SPINNER
static valSTYLE_SPINNER: Int
Deprecated: Deprecated in Java.
Creates a ProgressDialog with a circular, spinning progress bar. This is the default.
Value: 0Public constructors
ProgressDialog
ProgressDialog(context: Context!)
Creates a Progress dialog.
| Parameters | |
|---|---|
context | 
            Context!: the parent context | 
ProgressDialog
ProgressDialog(
context: Context!,
theme: Int)
Creates a Progress dialog.
| Parameters | |
|---|---|
context | 
            Context!: the parent context | 
theme | 
            Int: the resource ID of the theme against which to inflate this dialog, or 0 to use the parent context's default alert dialog theme | 
          
Public methods
getMax
open fungetMax(): Int
Deprecated: Deprecated in Java.
Gets the maximum allowed progress value. The default value is 100.
| Return | |
|---|---|
Int | 
            the maximum value | 
getProgress
open fungetProgress(): Int
Deprecated: Deprecated in Java.
Gets the current progress.
| Return | |
|---|---|
Int | 
            the current progress, a value between 0 and getMax() | 
          
getSecondaryProgress
open fungetSecondaryProgress(): Int
Deprecated: Deprecated in Java.
Gets the current secondary progress.
| Return | |
|---|---|
Int | 
            the current secondary progress, a value between 0 and getMax() | 
          
incrementProgressBy
open funincrementProgressBy(diff: Int): Unit
Deprecated: Deprecated in Java.
Increments the current progress value.
| Parameters | |
|---|---|
diff | 
            Int: the amount by which the current progress will be incremented, up to getMax() | 
          
incrementSecondaryProgressBy
open funincrementSecondaryProgressBy(diff: Int): Unit
Deprecated: Deprecated in Java.
Increments the current secondary progress value.
| Parameters | |
|---|---|
diff | 
            Int: the amount by which the current secondary progress will be incremented, up to getMax() | 
          
isIndeterminate
open funisIndeterminate(): Boolean
Deprecated: Deprecated in Java.
Whether this ProgressDialog is in indeterminate mode.
| Return | |
|---|---|
Boolean | 
            true if the dialog is in indeterminate mode, false otherwise | 
setIndeterminate
open funsetIndeterminate(indeterminate: Boolean): Unit
Deprecated: Deprecated in Java.
Change the indeterminate mode for this ProgressDialog. In indeterminate mode, the progress is ignored and the dialog shows an infinite animation instead.
Note: A ProgressDialog with style STYLE_SPINNER is always indeterminate and will ignore this setting.
| Parameters | |
|---|---|
indeterminate | 
            Boolean: true to enable indeterminate mode, false otherwise | 
See Also
setIndeterminateDrawable
open funsetIndeterminateDrawable(d: Drawable!): Unit
Deprecated: Deprecated in Java.
Sets the drawable to be used to display the indeterminate progress value.
| Parameters | |
|---|---|
d | 
            Drawable!: the drawable to be used | 
setMax
open funsetMax(max: Int): Unit
Deprecated: Deprecated in Java.
Sets the maximum allowed progress value.
setMessage
open funsetMessage(message: CharSequence!): Unit
Deprecated: Deprecated in Java.
setProgress
open funsetProgress(value: Int): Unit
Deprecated: Deprecated in Java.
Sets the current progress.
| Parameters | |
|---|---|
value | 
            Int: the current progress, a value between 0 and getMax() | 
          
setProgressDrawable
open funsetProgressDrawable(d: Drawable!): Unit
Deprecated: Deprecated in Java.
Sets the drawable to be used to display the progress value.
| Parameters | |
|---|---|
d | 
            Drawable!: the drawable to be used | 
setProgressNumberFormat
open funsetProgressNumberFormat(format: String!): Unit
Deprecated: Deprecated in Java.
Change the format of the small text showing current and maximum units of progress. The default is "%1d/%2d". Should not be called during the number is progressing.
| Parameters | |
|---|---|
format | 
            String!: A string passed to java.lang.String#format; use "%1d" for the current number and "%2d" for the maximum. If null, nothing will be shown. | 
setProgressPercentFormat
open funsetProgressPercentFormat(format: NumberFormat!): Unit
Deprecated: Deprecated in Java.
Change the format of the small text showing the percentage of progress. The default is NumberFormat.getPercentageInstnace(). Should not be called during the number is progressing.
| Parameters | |
|---|---|
format | 
            NumberFormat!: An instance of a NumberFormat to generate the percentage text. If null, nothing will be shown. | 
          
setProgressStyle
open funsetProgressStyle(style: Int): Unit
Deprecated: Deprecated in Java.
Sets the style of this ProgressDialog, either STYLE_SPINNER or STYLE_HORIZONTAL. The default is STYLE_SPINNER. 
Note: A ProgressDialog with style STYLE_SPINNER is always indeterminate and will ignore the  indeterminate setting.
| Parameters | |
|---|---|
style | 
            Int: the style of this ProgressDialog, either STYLE_SPINNER or STYLE_HORIZONTAL | 
          
setSecondaryProgress
open funsetSecondaryProgress(secondaryProgress: Int): Unit
Deprecated: Deprecated in Java.
Sets the secondary progress.
| Parameters | |
|---|---|
secondaryProgress | 
            Int: the current secondary progress, a value between 0 and getMax() | 
          
show
open static funshow(
context: Context!,
title: CharSequence!,
message: CharSequence!
): ProgressDialog!
Deprecated: Deprecated in Java.
Creates and shows a ProgressDialog.
| Parameters | |
|---|---|
context | 
            Context!: the parent context | 
title | 
            CharSequence!: the title text for the dialog's window | 
message | 
            CharSequence!: the text to be displayed in the dialog | 
| Return | |
|---|---|
ProgressDialog! | 
            the ProgressDialog | 
show
open static funshow(
context: Context!,
title: CharSequence!,
message: CharSequence!,
indeterminate: Boolean
): ProgressDialog!
Deprecated: Deprecated in Java.
Creates and shows a ProgressDialog.
| Parameters | |
|---|---|
context | 
            Context!: the parent context | 
title | 
            CharSequence!: the title text for the dialog's window | 
message | 
            CharSequence!: the text to be displayed in the dialog | 
indeterminate | 
            Boolean: true if the dialog should be  indeterminate, false otherwise | 
          
| Return | |
|---|---|
ProgressDialog! | 
            the ProgressDialog | 
show
open static funshow(
context: Context!,
title: CharSequence!,
message: CharSequence!,
indeterminate: Boolean,
cancelable: Boolean
): ProgressDialog!
Deprecated: Deprecated in Java.
Creates and shows a ProgressDialog.
| Parameters | |
|---|---|
context | 
            Context!: the parent context | 
title | 
            CharSequence!: the title text for the dialog's window | 
message | 
            CharSequence!: the text to be displayed in the dialog | 
indeterminate | 
            Boolean: true if the dialog should be  indeterminate, false otherwise | 
          
cancelable | 
            Boolean: true if the dialog is cancelable, false otherwise | 
          
| Return | |
|---|---|
ProgressDialog! | 
            the ProgressDialog | 
show
open static funshow(
context: Context!,
title: CharSequence!,
message: CharSequence!,
indeterminate: Boolean,
cancelable: Boolean,
cancelListener: DialogInterface.OnCancelListener!
): ProgressDialog!
Deprecated: Deprecated in Java.
Creates and shows a ProgressDialog.
| Parameters | |
|---|---|
context | 
            Context!: the parent context | 
title | 
            CharSequence!: the title text for the dialog's window | 
message | 
            CharSequence!: the text to be displayed in the dialog | 
indeterminate | 
            Boolean: true if the dialog should be  indeterminate, false otherwise | 
          
cancelable | 
            Boolean: true if the dialog is cancelable, false otherwise | 
          
cancelListener | 
            DialogInterface.OnCancelListener!: the listener to be invoked when the dialog is canceled | 
          
| Return | |
|---|---|
ProgressDialog! | 
            the ProgressDialog | 
Protected methods
onCreate
protected open funonCreate(savedInstanceState: Bundle!): Unit
Deprecated: Deprecated in Java.
| Parameters | |
|---|---|
savedInstanceState | 
            Bundle!: If this dialog is being reinitialized 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. |