Step #5: Creating an Empty Layout

To have DisplayFragment display the contents of a ToDoModel, it helps to have a layout resource.

Right-click over the res/layout/ directory and choose “New” > “Layout resource file” from the context menu. In the dialog that appears, fill in todo_display as the “File name” and ensure that the “Root element” is set to androidx.constraintlayout.widget.ConstraintLayout. Then, click “OK” to close the dialog and create the mostly-empty resource file.

Then, we are going to need to describe the UI that we want, setting up our widgets to display the different pieces of data in our ToDoModel. We will do that over the next several tutorial steps.


Prev Table of Contents Next

This book is licensed under the Creative Commons Attribution-ShareAlike 4.0 International license.