Learn how to add a Toggle Button to the Navigation Drawer

In order to add the Toggle button to your App you need to follow these steps

1. Add the following code to the Activity class


2. Override the onPostCreate method

protected void onPostCreate(Bundle savedInstanceState) {

3. Override the onConfigurationChanged method

public void onConfigurationChanged(Configuration newConfig){

4. Add following snippet to onOptionsItemSelected

return true;

Follow the Video to gain better understanding. You can refer to the source code here

Author: androidsmartly

I am a Tech Enthusiast who likes to work on new Ideas. Sharing knowledge on Android, Marketing, Startups and More.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s