Implementing the dialog designs

Now, we will do something that we have done many times before, but for a new reason. As we know, we will have two dialog windows. One for the user to enter a new note and one for the user to view a note of their choice.

We can design the layouts of these two dialog windows in exactly the same way as we have designed all our previous layouts. When we come to create the Java code for the DialogFragment classes, we will then see how we incorporate these layouts.

First, let's add a layout for our "new note" dialog:

  1. Right-click on the layout folder in the project explorer and select Layout resource file under New. Enter dialog_new_note in the File name field and RelativeLayout in the Root element field. Click on OK to generate ...

Get Android Programming for Beginners now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.