I have created a navigation drawer
in my application, Its working fine, but when i open another activity and go back to previous activity, the button of navigation drawer stops working, Although navigation drawer
is still there. If i slide from left to right it opens the drawer, but when i click on Hamburger
icon, it just doesn't do anything.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_base_navigation);
ViewGroup content = (ViewGroup) findViewById(R.id.base_layout);
getLayoutInflater().inflate(getLayoutRes(), content, true);
drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout_main);
headerLayout= (FrameLayout) findViewById(R.id.header_layout);
btnOpenDrawer= (Button) findViewById(R.id.btn_openDrawer);
homeLayout= (LinearLayout) findViewById(R.id.home_layout);
btnOpenDrawer.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
drawerLayout.openDrawer(Gravity.LEFT);
}
});
Kindly guide me that what i need to add in onRestart()
. Do i need to write all this code in onRestart()
as well?