Small rectangular pop-up notifications known as Toasts are by far the simplest way to inform a user of an application event, such as the completion of a download. Toasts are a fantastic way to notify a user of an event that he or she need not respond to, as Toasts dismiss themselves, do not interrupt any processes, or shift application or processor focus.
We have encountered Toasts already in this book simply because they are so easy to implement, but now it is time to take a closer look.
Toasts are great mainly because they can be implemented in a single line of code. Here however, we will deconstruct the process somewhat, to show the inner workings in greater detail. Start up a new Android project in Eclipse and make your way to the main Java activity code.