In this recipe, we will be making use of the following methods:
- dialogCreateAlert(): This method is used to display a message via a dialog box
- dialogSetPositiveButtonText(): This method is used to display the Yes button in a dialog box
- dialogSetNegativeButtonText(): This method is used to display the No button in a dialog box
- dialogSetNeutralButtonText(): This method is used to display the Cancel button in a dialog box
- dialogGetResponse(): This method is used to take the response from the user via a dialog box
Take a look at the following steps:
- Type the following code in the Python script demoDialog.py in the current folder of your computer:
import androidapp = android.Android()title = 'Understanding Dialog Buttons'