Skip to content

CustomViewDialog

Philipp Niedermayer edited this page Jan 3, 2017 · 13 revisions

CustomViewDialog

extends SimpleDialog

Extend this class to create a dialog with a custom view.

Inflate view

protected abstract View onCreateContentView(Bundle savedInstanceState)

Inflate, setup and return your custom view here.

Providing results

protected Bundle onResult(int which)

Overwrite this method to return a Bundle that will be merged into the results returned by OnDialogResultListener.onResult.

Various

Overwrite this method to take action once the dialog is shown such as settings the initial state of the positive button or an input focus:

protected void onDialogShown()

Overwrite and return false from this function if you don't want the dialog to be closed yet, for example due to an invalid user input:

protected boolean acceptsPositiveButtonPress()

Other methods:

protected void pressPositiveButton()
protected void setPositiveButtonEnabled(boolean enabled)

Clone this wiki locally