Android Question AS Settings - Boolean

sigster

Active Member
Licensed User
Longtime User
Hi

How can I have only one Boolean True
when I select
PropertyName_1 True then PropertyName_2 and PropertyName_3 will be False automatic
PropertyName_2 True then PropertyName_1 and PropertyName_3 will be False automatic
PropertyName_3 True then PropertyName_1 and PropertyName_2 will be False automatic

B4X:
propbag.AddProperty_Boolean("Basic","PropertyName_1","Boolean Property True","Description Test Text",Null,True)
 propbag.AddProperty_Boolean("Basic","PropertyName_2","Boolean Property True","Description Test Text",Null,False)
 propbag.AddProperty_Boolean("Basic","PropertyName_3","Boolean Property True","Description Test Text",Null,False)


Regards
Sigster
 

Alexander Stolte

Expert
Licensed User
Longtime User
 
Upvote 0

sigster

Active Member
Licensed User
Longtime User
Thanks

It works like this

B4X:
Select Property.PropertyName
        Case "PropertyName_1"       
            AS_Settings1.MainPage.GetProperty("PropertyName_2").View.As(B4XSwitch).Value = False
            AS_Settings1.MainPage.GetProperty("PropertyName_3").View.As(B4XSwitch).Value = False
        Case "PropertyName_2"
            AS_Settings1.MainPage.GetProperty("PropertyName_1").View.As(B4XSwitch).Value = False
            AS_Settings1.MainPage.GetProperty("PropertyName_3").View.As(B4XSwitch).Value = False
        Case "PropertyName_3"
            AS_Settings1.MainPage.GetProperty("PropertyName_1").View.As(B4XSwitch).Value = False
            AS_Settings1.MainPage.GetProperty("PropertyName_2").View.As(B4XSwitch).Value = False
        Case Else
            Log("PropertyName: " & Property.PropertyName & " Value: " & Value)
    End Select
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…