Android Question checkbox array.

techknight

Well-Known Member
Licensed User
Longtime User
I am adding checkboxes to an array via a tag, using this function:

chkScoreBoard = Array As CheckBox(chkScoreBoard1, chkScoreBoard2, chkScoreBoard3, chkScoreBoard4, chkScoreBoard5)

Now, How do I handle the checkedchange? I cant get it to work.
B4X:
Sub chkScoreBoard_CheckedChange(checked As Boolean)
Log("CLICK: " & checked)
End Sub

I keep getting "parameter name cannot hide global variable name" error.

any ideas?
 

techknight

Well-Known Member
Licensed User
Longtime User
I found one of my problems.

In the globals, I am using:

B4X:
Dim checked, unchecked, disabled As ColorDrawable
    Dim sld As StateListDrawable
    Dim sld2 As StateListDrawable
    Dim sld3 As StateListDrawable
    Dim sld4 As StateListDrawable
    sld.Initialize
    sld2.Initialize
    sld3.Initialize
    sld4.Initialize
    sld.AddState(sld.State_Checked, checked)
    sld.AddState(sld.State_Unchecked, unchecked)
    sld.AddState(sld.State_Disabled, disabled)
to colorize my togglebuttons. So i just changed the checked to checked2 to avoid the conflict.

This got rid of my global override error, but the event still never gets raised.

I tried chkscoreboard().initialize("chkscoreboard") and it crapped out with parameter missing
 
Last edited:
Upvote 0
Top