4.9 Android Dialog : Page 2 of 3

Create a suitable emulator and run the application. Output should be similar to the following snapshot:

Homepage of Android Dialog example app

Figure - Homepage of Android Dialog example app

Now press the button saying Show Dialog and a list of fruits is displayed on the screen. Output should be similar to the following snapshot:

Output after pressing the Show Dialog button

Figure  - Output after pressing the Show Dialog button

As soon as you select any fruit you would be notified about your selection. I am selecting Apple and the output should be similar to the following snapshot:

Output after selecting an item

Figure -  Output after selecting an item

As soon as you press the button saying Select then the dialog disappears and we are reverted to our homepage of app. So output should be similar to the following snapshot:

Output after clicking button Select

Figure - Output after clicking button Select

When you click the button saying Show Dialog again, you would notice that your selection is still retained. So output should be similar to the following snapshot:

Figure - Output after re-pressing Show Dialog button

Figure - Output after re-pressing Show Dialog button

Now press the button saying Discard and you would be in your homepage again. A message about this selection would be displayed. Output should be similar to the following snapshot:

Figure - Output after pressing the button saying Discard

Figure - Output after pressing the button saying Discard

Now press the button saying Next and you would be moved to next Activity. Output should be similar to the following snapshot:

Next Activity

Figure - Next Activity

As soon as we press the button saying Progress our simulation of download will start. Output should be similar to the following snapshot:

Output after pressing the Progress button App

                       Figure - Output after pressing the Progress button App

Press the button saying Hide, dialog disappears and we are moved back to the main page. Users would be notified about this selection. Output should be similar to the following snapshot:

Output after pressing the button Hide

Figure  - Output after pressing the button Hide

Now as we click the button saying progress, our simulation will restart. Output should be similar to the following snapshot:

 Output after re-pressing the Progress button

Figure - Output after re-pressing the Progress button

Now as soon as we press the button saying cancel. We are reverted to our main screen.  Output should be similar to the following snapshot:

After pressing cancel button

Figure - After pressing cancel button

Let us move to next example