Android Example [B4X] AS Settings - Master and child switch


You need AS_Settings V2.00+ for this example.

In the following example, PropertyName_2 and PropertyName_3 are set to the same value as PropertyName_1. e.g. PropertyName_2 and PropertyName_3 are dependent on PropertyName_1, if PropertyName_1 = False then the other 2 should also be False.

B4X:
Private Sub AS_Settings1_ValueChanged(Property As AS_Settings_Property, Value As Object)
    Select Property.PropertyName
        Case "PropertyName_1"
            AS_Settings1.MainPage.SetProperty_Boolean("PropertyName_2",Value)
            AS_Settings1.MainPage.SetProperty_Boolean("PropertyName_3",Value)
        Case Else
            Log("PropertyName: " & Property.PropertyName & " Value: " & Value)
    End Select
End Sub

 
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…