disable the swipe gesture that opens the navigation drawer in android

user1627990 picture user1627990 · Jun 11, 2013 · Viewed 81.4k times · Source

I've been following the navigation drawer guide by Google and I'd like to add it to an Activity with tabs and gestures.

I'd like to disable the gesture to open the navigation drawer, does anyone have any idea how to do this?

Answer

Tran Hieu picture Tran Hieu · Jun 18, 2013

You should use:

mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);

It worked for me, the swipe to open the drawer was disabled.

If it still won't work, check out the answer provided here.