Android Navigation Drawer


Overview

You are going to learn about how to use Navigation Drawer in Android


Concepts

Android Navigation Drawer is a panel that can displays a list of options on left side of the screen .When clicked on each option user can be directed to a new Activity .It is usually hidden ,but revealed when swiped from left edge of the screen .It can also be opened when clicked on App Bar icon

Samples

For a navigation drawer to work ,you main XML file root must be a DrawerLayout .That means the xml file you are going to link with the Activity file on setContentView must have DrawerLayout tag as root

Drawer Layout has two parts , One for the Side-Menu and one more for the Actual Layout (FrameLayout).Tha Side menu will be displayed when Navigation Drawer is active and Actual Layout will be displayed when its closed

The Actual Navigation Drawer is nothing but a ListView and each ListItem is displayed as an option

Tutorial

Aim

1)To build a app with two options , Contacts and Countries .

2)When clicked on Contacts , Control goes to a new Activity called Contacts and displays it.

Steps

Task Navigation Drawer

Aim

Project Sample Images

This is first screen

This is Navigation Drawer

Contacts Activity

Countries Activity