Sets whether the dialog is cancelable or not. The default of the AlertDialog.Builder is true if this item is not included in your AlertDialog.Builder upon creation.
Returns: This Builder object to allow for chaining of calls to set methods
1. Create an AlertDialog with Supplied Arguments
2. After your AlertDialog.Builder is instantiated in step 1, add the following line to set the AlertDialog so it is not cancelable. The user will not be able to press the back button to cancel the AlertDialog. The user must select an option on the AlertDialog, or close the app altogether.
3. Compile and run!
Next Recommended Article: How to Set an AlertDialog.Builder Positive Button Listener
Resources:
http://developer.android.com/reference/android/app/AlertDialog.Builder.html#setCancelable(boolean)