I am creating one app,and i am using NavigationDrawer
and Fragments
in my application,now issue is I have five ListItems
in Navi
You shouldn't try to hide the drawer items. I would just update the adapter, remove the items you don't need and then invalidate it.
When the user clicks on Signout
, I would just do something like this:
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
// display view for selected nav drawer item
displayView(position);
// if using fixed positions
if(position == 6) { // position of Sign out button
navDrawerItems.clear(); // empty the adapter array
navDrawerItems.add(new NavDrawerItem(navMenuTitles[signoutIndex], navMenuIcons.getResourceId(signoutIndex, -1));
adapter.notifyDataSetChanged();
}
}