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 Java until we have learned about Android databases in the next chapter.
After 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 have any functionality 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 and selecting New | Layout resource file. Name the first file content_insert
, the second content_delete
, the third content_search
, and the fourth content_results
. All the options apart from the LinearLayout
option and...