Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

how to hide menu items in android

//anywhere in your code
...
mState = HIDE_MENU; // setting state
invalidateOptionsMenu(); // now onCreateOptionsMenu(...) is called again
...

@Override
public boolean onCreateOptionsMenu(Menu menu)
{
    // inflate menu from xml
    MenuInflater inflater = getSupportMenuInflater();
    inflater.inflate(R.menu.settings, menu);

    if (mState == HIDE_MENU)
    {
        for (int i = 0; i < menu.size(); i++)
            menu.getItem(i).setVisible(false);
    }
}
Comment

PREVIOUS NEXT
Code Example
Java :: java random unique number 
Java :: java random primary key 
Java :: set intersection java 
Java :: javafx location is required 
Java :: array liste java 
Java :: intent in fragment android 
Java :: binding fragment android 
Java :: android localdatetime 
Java :: jsonarray to list java 
Java :: android BottomSheetDialogFragment not opening fully on landscape 
Java :: pass list to intent in android java 
Java :: datetimeformatter for java 
Java :: n queens problem leetcode 
Java :: java go troght loop object 
Java :: how to declare an array in java 
Java :: java lowercase 
Java :: check have string have just numbers 
Java :: java Modulo 10^9+7 (1000000007) 
Java :: java remove trailing zeros from float 
Java :: string to byte array java 
Java :: android dismiss keyboard 
Java :: get driver mysql 
Java :: java stream distinct by object atribute 
Java :: java get all directories in path 
Java :: awk print second 
Java :: running sum of 1d array java 
Java :: how to declare and insert value to arraylist in same line in java 
Java :: generatedvalue spring boot 
Java :: how to check the end of a string java 
Java :: spring scheduled 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =