Coding the Fragment classes and their layouts
We will create the four classes, including the code that loads the layout as well as the actual layouts as well, but we won't put any of the database functionality into the Java code until we have learned about Android databases in the next chapter.
Once we have our four classes and their layouts, we will see how to load them from the Navigation Drawer menu. By the end of the chapter, we will have a fully working Navigation Drawer that lets the user swap between fragments, but the fragments won't actually do anything until the next chapter.
Creating the empty files for the classes and layouts
Create four layout files with vertical LinearLayout
as their parent view by right-clicking on the layout
folder ...
Get Android Programming for Beginners - Second Edition 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.