Android Question I want to cancel Activity.AddMenuItem2

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

  1. Tayfur

    Tayfur Well-Known Member Licensed User


    I create some manu items.
    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.

    dim shw_menu as boolean
    true ' or false
    if shw_memu then
    '... menu can show (disable=true)
    ' ????code ...(you said to me)
    ' --- 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

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

    Tayfur Well-Known Member Licensed User

    it is very smarty ;)
  5. Tayfur

    Tayfur Well-Known 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.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice