Android Question ClsActionbar submenu

Jeboiii

Member
Licensed User
Longtime User
I used clsactionbar. I don't know how to put submenu in it. Anyone who can give me code on how to do it? I know its too easy for you guys.

==============
Sub Globals
Dim AB As ClsActionBar
Dim BtnHome As View
Dim Panel1 As Panel
End Sub

Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Main")
AB.Initialize(Panel1, True, True, Panel1.Height, Me)
BtnHome = AB.AddButton(Null, "", 5, 1, "", "")

AB.Title.Text = "Sample"
AB.Title.TextSize = 16

AB.Title.Left = AB.AsPanel.Height + 10dip

AB.AddButton(LoadBitmap(File.DirAssets, "menu.png"), "", 5, -1, "Menu_Click", "")

Dim gd As GradientDrawable, col(2) As Int
col(0) = Colors.RGB(22, 85, 128)
col(1) = Colors.RGB(34, 57, 120)
gd.Initialize("TOP_BOTTOM", col)
AB.SetBackground(gd)
End Sub

Sub Menu_Click(ActionBar As ClsActionBar, Btn As View)
'Code here??????????? :)
End sub
 

stanks

Active Member
Licensed User
Longtime User
smthg like:

B4X:
    Select AB.getLeftPosition(Btn)
        Case 1    ' first button from the left
        Case 2    ' 2nd button from the left
...
...
    End Select
 
Upvote 0

ma7tin

Member
Licensed User
I used clsactionbar. I don't know how to put submenu in it. Anyone who can give me code on how to do it? I know its too easy for you guys.

==============
Sub Globals
Dim AB As ClsActionBar
Dim BtnHome As View
Dim Panel1 As Panel
End Sub

Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Main")
AB.Initialize(Panel1, True, True, Panel1.Height, Me)
BtnHome = AB.AddButton(Null, "", 5, 1, "", "")

AB.Title.Text = "Sample"
AB.Title.TextSize = 16

AB.Title.Left = AB.AsPanel.Height + 10dip

AB.AddButton(LoadBitmap(File.DirAssets, "menu.png"), "", 5, -1, "Menu_Click", "")

Dim gd As GradientDrawable, col(2) As Int
col(0) = Colors.RGB(22, 85, 128)
col(1) = Colors.RGB(34, 57, 120)
gd.Initialize("TOP_BOTTOM", col)
AB.SetBackground(gd)
End Sub

Sub Menu_Click(ActionBar As ClsActionBar, Btn As View)
'Code here??????????? :)
End sub


Hi have you got any answer about this ?
 
Upvote 0
Top