android - Cannot open navigationbar -


i click floatingactionbutton open navigation menu, not working

drawerlayout drawer = (drawerlayout) findviewbyid(r.id.drawer_layout);     floatingactionbutton fab = (floatingactionbutton) findviewbyid(r.id.fab);     fab.setonclicklistener(new view.onclicklistener() {         @override         public void onclick(view view) {             drawer.isdraweropen(gravitycompat.start);         }     }); 

no errors in logcat.
1 help.

your isdraweropen method checks if drawer open or not , not doing checks. can use in onclick method:

if(drawer.isdraweropen(gravitycompat.start)) {     closenavdrawer(); }else {     drawer.opendrawer(gravitycompat.start); } 

closenavdrawer method:

protected void closenavdrawer() {     if (drawer != null) {         drawer.closedrawer(gravitycompat.start);     } } 

Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -