I am developing an application, which contains one menu drawer
, however, I'm a multitoque
problem, ie when the user selects an item, and quickly selects again, it keeps drawer aberto
.
I would like that when the user selects an item, drawer
will close, and ignore the second click.
The event I treat today is like this
exp_list_fragments.setOnChildClickListener(new ExpandableListView.OnChildClickListener() {
@Override
public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) {
if (groupPosition == 3 && childPosition > 0) {
switch (childPosition) {
case 1:
logoutApplication(false);
break;
case 2:
DialogSendEmail d = new DialogSendEmail(Activity_Main.this);
d.show();
break;
case 3:
rt.questionExitSystem();
break;
}
} else {
Child_Fragments child_fragment = group_fragments.get(groupPosition).getFragments().get(childPosition);
controller.setActionBarTitle(child_fragment.getTitle(), child_fragment.getIcone());
supportInvalidateOptionsMenu();
getSupportFragmentManager().beginTransaction().replace(R.id.layout_drawer_content,
child_fragment.getFragment()).commit();
}
setFragmentSelection(groupPosition, childPosition);
layout_drawer.closeDrawer(layout_drawer_drawer);
return false;
}
});
}