show Menu Item - Android User Interface

Android examples for User Interface:Menu

Description

show Menu Item

Demo Code


//package com.java2s;
import android.view.Menu;
import android.view.MenuItem;

public class Main {
    static public MenuItem showMenuItem(final Menu menu, final int itemId,
            final boolean show) {
        final MenuItem mi = menu.findItem(itemId);
        if (mi != null)
            mi.setVisible(show);//from  w w  w. j  a v a  2 s  .co  m
        return mi;
    }
}

Related Tutorials