ICSMenuPopup with AHActionBar not working in my source.

SCIS

Active Member
Licensed User
Longtime User
Like the title says, it isn't working in my project:
B4X:
'Activity module
Sub Process_Globals
   'These global variables will be declared once when the application starts.
   'These variables can be accessed from all modules.
   Dim ID_ACTION_HOME As Int     : ID_ACTION_HOME     = 0
   Dim ID_ACTION_REFRESH As Int  : ID_ACTION_REFRESH  = 1
   Dim ID_ACTION_STAR As Int     : ID_ACTION_STAR     = 2
   Dim ID_ACTION_SHARE As Int    : ID_ACTION_SHARE    = 3
   Dim ID_ACTION_OVERFLOW As Int : ID_ACTION_OVERFLOW = 99
End Sub

Sub Globals
   'These global variables will be redeclared each time the activity is created.
   'These variables can only be accessed from this module.
   Dim AB As AHActionBar 
   
   Dim Button1 As Button
   Dim Button2 As Button
   Dim Button3 As Button
   
   Dim homeIcon As     BitmapDrawable
   Dim overflowIcon As BitmapDrawable
   Dim shareIcon As    BitmapDrawable
   Dim refreshIcon As  BitmapDrawable
   Dim starIcon As     BitmapDrawable
   
   Dim q As ICSMenuPopup
End Sub

Sub Activity_Create(FirstTime As Boolean)
   Activity.LoadLayout("Screenresol")
   
   q.Initialize("AC")

AB.Initialize("AB")
AB.Title="ICS Menu Test"

AB.UseLogo=True

homeIcon.Initialize    (LoadBitmap(File.DirAssets, "ic_title_home_default.png"))
overflowIcon.Initialize(LoadBitmap(File.DirAssets, "ic_action_overflow.png"))
shareIcon.Initialize   (LoadBitmap(File.DirAssets, "ic_action_share.png"))
refreshIcon.Initialize (LoadBitmap(File.DirAssets, "ic_action_refresh.png"))
starIcon.Initialize    (LoadBitmap(File.DirAssets, "ic_action_star.png"))

AB.ActionWidth = 42dip
AB.addAction(ID_ACTION_OVERFLOW, overflowIcon)


Dim a As AHActionItem 
a.Initialize(1,"Hello",shareIcon)
q.addActionItem(a)
a.Initialize(1,"Hello Again",homeIcon)
q.addActionItem(a)
a.Initialize(1,"And again",starIcon)
q.addActionItem(a)

End Sub
Sub Button1_click
   Msgbox("dit werkt","joepie")
End Sub
Sub Button2_click
   Dim ItemID As Int
   Select ItemID
      Case ID_ACTION_OVERFLOW
         q.show(AB.GetActionView(ItemID))
   End Select
End Sub
Sub Button3_click
   Msgbox("dit werkt ook al","joepie")
End Sub
Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Zip of source in attechment.

Greetings,
SCIS.
 
Last edited:
Top