In Android, when an alert appears, the background is dimmed. I would like a similar effect for when the menu is opened. I tried the following code, but it didn't work:
@Override
public boolean onMenuOpened(int featureId, Menu m) {
boolean ret=super.onMenuOpened(featureId,m);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
return ret;
}
Does anyone know how to achieve this?