final Drawer drawer = new DrawerBuilder()
.withActivity(this)
.withToolbar(toolbar)
.withActionBarDrawerToggle(true)
.withAccountHeader(headerResult)
.withCloseOnClick(true)
.addDrawerItems(
new PrimaryDrawerItem()
.withIcon(FontAwesome.Icon.faw_home)
.withName("Home")
.withIconColor(getResources().getColor(R.color.colorAccent))
.withIdentifier(0)
.withSelectable(false),
new PrimaryDrawerItem()
.withIcon(FontAwesome.Icon.faw_cogs)
.withName("Settings")
.withSelectable(false)
.withIconColor(getResources().getColor(R.color.colorAccent))
.withIdentifier(1),
new DividerDrawerItem(),
new PrimaryDrawerItem()
.withIcon(FontAwesome.Icon.faw_bullhorn)
.withName("Tell a Friend")
.withIconColor(getResources().getColor(R.color.colorAccent))
.withIdentifier(2)
.withSelectable(false),
new PrimaryDrawerItem()
.withIcon(FontAwesome.Icon.faw_user)
.withName("About")
.withSelectable(false)
.withIconColor(getResources().getColor(R.color.colorAccent))
.withIdentifier(3),
new PrimaryDrawerItem()
.withIcon(FontAwesome.Icon.faw_gift)
.withName("Donate")
.withSelectable(false)
.withIconColor(getResources().getColor(R.color.colorAccent))
.withIdentifier(4)
)
.withSelectedItem(-1)
This is my code even have done .withCloseOnClick(true) it is still not closing the drawer on item click
@mtwn105 do you have a clickListener? You should return false in the onClickListener, to state that you don't consume the event
got it! thanks @mikepenz
Most helpful comment
@mtwn105 do you have a
clickListener? You should returnfalsein the onClickListener, to state that you don't consume the event