setNegativeButton

fun setNegativeButton(text: CharSequence, title: CharSequence, listener: View.OnClickListener?)

Sets the NegativeButton with the passed text for the ProgressDialog and also sets the OnClickListener for the Button. NegativeButton is hidden by default. This method makes it visible. This method also enables the Title to be shown (even if it was hidden till then). If setTitle or setTitle was used before, and new Title is passed, the new Title will Override the previously set Title. If null is passed for listener, default listener which dismisses the ProgressDialog when clicked, will be used.

Parameters

text

The text to be set in the NegativeButton.

listener

The View.OnClickListener listener to be set to NegativeButton. If null, default cancel listener will be used.


fun setNegativeButton(@StringRes textResID: Int, @StringRes titleResID: Int, listener: View.OnClickListener?)

Sets the NegativeButton with the text from passed resource id for the ProgressDialog and also sets the OnClickListener for the Button. NegativeButton is hidden by default. This method makes it visible. This method also enables the Title to be shown (even if it was hidden till then). If setTitle or setTitle was used before, and new titleResID is passed, the new Title will Override the previously set Title. If null is passed for listener, default listener which dismisses the ProgressDialog when clicked, will be used.

Parameters

textResID

The resource id of the text to be set in the NegativeButton.

listener

The View.OnClickListener listener to be set to NegativeButton.