Hi All,
I am using the Calendar (or Kalender) and I need to show which day was pressed. In Delphi I would just hold that button in a key pressed state.
How can I do this in b4a?
My Calendar is visible on screen with database action happening with day changes.
Maybe you should use a ToggleButton instead of a regular button.
You can however do it with the help of the reflection library:
B4X:
Sub Activity_Create(FirstTime As Boolean)
b.Initialize("b")
Activity.AddView(b, 0, 0, 100, 100)
SetPressed(b, True)
End Sub
Sub SetPressed(Btn As Button, Pressed As Boolean)
Dim r As Reflector
r.Target = b
r.RunMethod2("setPressed", Pressed, "java.lang.boolean")
End Sub
Thanks for that used Toggle Button
Only thing I needed to do was increase the button size.
Seems as though 50 is the min with for the toggle button.
The checked gree bar must be a fixed with, not in proportion to the with of the button.