In my dialog the user is required to input a name to save a file. If it's not entered a toast should appear saying that a file name is required and the dialog should remain. How to implement this in the positive button click listener and prevent the dialog from closing if the file name isn't specified? Here's the listener:
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setPositiveButton("Save", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {