Notification dialog box
Gets the alertdialog.builder object, through the new Builder (context) parameter: Contexts
Call the Settitle () method of the Builder Object , set the caption, parameter: text
Call the SetIcon () method of the Builder Object , set the small icon, parameter: resource ID, R.drawable.xxx
Call the setmessage () method of the Builder Object , set the contents, Parameters: Text content
Call the Setpositivebutton () method of the Builder Object , set the OK button, parameter:String 's button text, Onclicklistener object, which is an interface, an anonymous inner class implements an interface, overrides OnClick () method,
Call the Setnegativebutton () method of the Builder Object , set the Cancel button, and the parameter: same as above
Call the Builder object's create () method to get the alertdialog Object
Call the Show () method of the alertdialog object to show the dialog box
Single-selection dialog box
Gets the alertdialog.builder object, through the new Builder (context) parameter: Contexts
Call the Settitle () method of the Builder Object , set the caption, parameter: text
Call the Setsinglechoicesitems () method of the Builder object to set the radio options,
Parameter:items,checkeditem,listener
Items is an array of string[] options
Checkeditem is the index of the default selected option and is not filled in -1
Onclicklistener Object, implement it, pass in two parameters, call the dialoginterface object's dismiss () method, close the dialog box
Call the Builder object's show () method to show
The Multiple selection dialog box is almost identical to the radio dialog, except for setting the listener event
Call the Setmultichoicesitems () method of the Builder object to set the multi-select option,
Parameter:items,checkeditems,listener
Items is an array of string[] options
CheckedItems is the index of the default selected option boolean[],new boolean[]{}
Onclicklistener Object, implement it, handle it in the OnClick () method
Progress Bar dialog box (progressdialog)
Get progressdialog object, come out with new
Call the settitle () setmessage ( ) method of the progressdialog object To set the prompt information
Call the Show () method of the progressdialog Object and show it
Call the Setprogressstyle () method of the progressdialog object to set the progress style, parameters: Progressdialog.style_horizontal
Call the Setmax of the ProgressDialog object
Open a sub-thread, inside A for loop, three times, call The ProgressDialog object's Setprogress () method, thread sleep a bit, show the effect
[Android] common dialog box