How can I use button to show/hide Navigation Drawer, I have used this SO link to create and manage Navigation Drawer.
Now i am using (Swipe to right from left - to show)
If you are using Sliding Drawer Menu, and you want to hide the menu when it is open (when drag from right to left). Then we have to deal with listview object ontouch listener. The code will be like this.
//((( When we drage from Right to left then menu hide ))))
lvMenu.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
switch (event.getAction())
{
case MotionEvent.ACTION_DOWN:
toggleMenu(v);
break;
case MotionEvent.ACTION_UP:
//showtoast("up");
break;
default:
return false;
}
return false;
}
});
public void toggleMenu(View v) {
mLayout.toggleMenu();
}
For complete code, you can put the comment here, if you have any problem