Code example for MenuItem

Methods: setShowAsAction

0
		return false;  // shortcut is not very noticeable 
	} 
 
	@Override 
	public void menuItemSetShowAsAction(MenuItem mi, int flags) {
		mi.setShowAsAction(flags);
	} 
 
	@Override 
	public void lightsOut(Window w, View v, boolean dim) {
		v.setSystemUiVisibility(dim ? View.SYSTEM_UI_FLAG_LOW_PROFILE
				: View.SYSTEM_UI_FLAG_VISIBLE);
	} 
 
	@Override 
	public void addOnMenuVisibilityListener(final OnMenuVisibilityListener l)
	{ 
		actionBar.addOnMenuVisibilityListener(new ActionBar.OnMenuVisibilityListener() {
			@Override public void onMenuVisibilityChanged(boolean isVisible) {
				l.onMenuVisibilityChanged(isVisible);
			}