Does the user need to be able to perform an advanced action in the dialog box?

258 Part III: Creating a Feature-Rich Application ✓ On Save: When the user attempts to save the form that he is working with, inspect all the form fields at that time and inform the user of any issues found. ✓ onFocusChanged: Inspect the values of the form when the onFocus- Changed event is called — which is called when the view has focus and when it loses focus. This is usually a good place to set up validation. The Task Reminder application does not provide input validation; however, you can add validation via one of the methods described previously. Toasting the user The most common way to inform the user that something is incorrect is to provide a Toast message to her. A Toast message pops onto the screen for a short period of time informing the user of some type of information — in this case, an error with input values. Providing a Toast is as simple as implementing the following code, where you’d like to inform the user of the input error: Toast.makeTextReminderEditActivity.this, “Title must be filled in”, Toast. LENGTH_SHORT.show; You might show this Toast message when the user does not enter a title into the title field, and the user clicks the Save button. The only issue with Toast messages is that they are short-lived by default, yet they can be configured to display longer. If the user happens to glance away for a moment, he can miss the message because the Toast message only shows up for a few moments and then fades out. Using other validation techniques A Toast message is not the only way to inform users of a problem with their input. A couple of other popular validation techniques are as follows: ✓ AlertDialog : Create an instance of an AlertDialog that informs the user of the errors. This method ensures that the user will see the error message because the alert must either be canceled or accepted. ✓ Input-field highlighting: If the field is invalid, the input field the EditText widget could have its background color changed to red or any color you choose to indicate that the value is incorrect.