Android Question I want to cancel Activity.AddMenuItem2

Discussion in 'Android Questions' started by Tayfur, Jul 1, 2015.

  1. Tayfur

    Tayfur Active Member Licensed User

    hello;

    I create some manu items.
    Code:
    Activity.AddMenuItem2("1 title","1deneme",LoadBitmap(File.DirAssets,"files-icon.png"))
            
    Activity.AddMenuItem2("11 title","11deneme",LoadBitmap(File.DirAssets,"files-icon.png"))
            
    Activity.AddMenuItem2("12 title","12deneme",LoadBitmap(File.DirAssets,"files-icon.png"))
    So I want to, some times menu showable sometimes it not show.

    Code:
    dim shw_menu as boolean
    shw_menu=
    true ' or false
    if shw_memu then
    '... menu can show (disable=true)
    ' ????code ...(you said to me)
    else
    ' --- menu con not show (disable=false)
    ' ????code ...(you said to me)
    end if
    How is can ??
     
  2. DonManfred

    DonManfred Expert Licensed User

    You can not remove or disable a menuitem.

    You need to use an Actionbar where you can place your own menu.
    Look out for libraries which can add/change/disable/remove menuitems
    For ex MSMaterialDrawer
     
  3. picenainformatica

    picenainformatica Active Member Licensed User

    Code:
    Sub Activity_KeyPress (KeyCode As Int) As Boolean   
        
    If KeyCode = KeyCodes.KEYCODE_MENU Then
                
    if shw_memu then
                    
    Return False
                
    else
                    
    Return True
                
    end if
        
    Else
            
    Return false
        
    End If 
    End Sub
     
    hibrid0, Tayfur and DonManfred like this.
  4. Tayfur

    Tayfur Active Member Licensed User

    it is very smarty ;)
    thnx
     
  5. Tayfur

    Tayfur Active Member Licensed User

    I willl look your lib.
    thanks for your feedback.
     
  6. DonManfred

    DonManfred Expert Licensed User

    It´s not my lib!

    It´s a library from @thedesolatesoul
     
    lemonisdead and Peter Simpson like this.
Loading...