Class MainActivity

    • Constructor Detail

      • MainActivity

        public MainActivity()
    • Method Detail

      • onCreate

        protected void onCreate​(Bundle savedInstanceState)
        Overrides the onCreate method in AppCompatActivity. Instantiates local variables. Specifically, uses layout screens as defined in the activity_main layout in res/layout. Sets up the navigation structure that allows users to navigate throughout the app.
        Overrides:
        onCreate in class FragmentActivity
        Parameters:
        savedInstanceState - a Bundle.
      • onCreateOptionsMenu

        public boolean onCreateOptionsMenu​(Menu menu)
        Overrides the onCreateOptionsMenu method in AppCompatActivity. Creates two menu options (Sign out and Settings) as specified in the res/menu main.xml file.
        Overrides:
        onCreateOptionsMenu in class Activity
        Parameters:
        menu - a menu item.
        Returns:
        a boolean representing if the menu was created successfully or not.
      • onOptionsItemSelected

        public boolean onOptionsItemSelected​(@NonNull
                                             MenuItem item)
        Overrides the onOptionsItemSelected method in AppCompatActivity. Specifies what to do if the user clicks on each menu item (Sign out versus Settings).
        Overrides:
        onOptionsItemSelected in class Activity
        Parameters:
        item - a menu item.
        Returns:
        a boolean representing if the item was handled successfully or not.
      • onSupportNavigateUp

        public boolean onSupportNavigateUp()
        Initiates a navigation bar.
        Overrides:
        onSupportNavigateUp in class AppCompatActivity
        Returns:
        boolean value if the user navigated to the top level navigation.