Toasting success

Sometimes it is nice to have a positive confirmation when actions are completed successfully. Toasts are a way within Android to display a short message that will disappear after a specified amount of time. The Toast class is used to accomplish this. The following listing depicts calls to MakeText() and Show():

Toast toast = Toast.MakeText (this, String.Format ("{0} deleted.",_poi.Name), ToastLength.Short);
toast.Show();

Add toasts prior to the call to Finish() in both the SavePOI() and ConfirmDelete() methods. Refer to the source in the code bundle for an example.

Run POIApp and confirm that the toasts are displaying correctly.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.33.178