DrawerLayout mDrawerLayout= (DrawerLayout) findViewById(R.id.drawer_layout)
closeDrawer(); // called when you want to close
public void closeDrawer() {
if (mDrawerLayout.isDrawerOpen(GravityCompat.START)) {
mDrawerLayout.closeDrawer(GravityCompat.START);
}
}