Actually I was using One MainActivity and multiple Fragments attached to it. I want to change Navigation Drawer Menu Icon of toolbar from certain fragments as back icon.And set back pressed event for that icon. here is my code
drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
drawer.setDrawerListener(toggle);
toggle.syncState();