Skip to content

SimpleCheckDialog

Philipp Niedermayer edited this page Jun 12, 2021 · 20 revisions

CheckBox dialog

extends CustomViewDialog, Full API reference

A dialog with a checkbox.

Building dialogs

Example

SimpleCheckDialog.build()
            .title(R.string.terms_and_conditions)
            .msgHtml(R.string.terms_text_html)
            .label(R.string.read_and_accepted)
            .checkRequired(true)
            .pos(R.string.accept)
            .neut()
            .cancelable(false)
            .show(Activity.this, TERMS_DIALOG);

Available customizations

  • Checkbox label
    java .label(String title), .label(int resId)
  • Checkbox initial state
    .check(boolean checked)
  • Required flag
    .checkRequired(boolean required)
    If set to true, the positive button will be disabled as long as the checkbox is not checked.

Receiving results

See Receiving results from SimpleDialog. The extras Bundle returned will contain the following keys:

boolean CHECKED    // Weather the checkbox was checked