Android Question StateManager does not have support for SwitchView ?

rleiman

Well-Known Member
Licensed User
Longtime User
Hi Everyone,

Has anyone tried to use the SwitchView and StateManager together?

Seems like it may need support for SwitchViews.

I placed views such as toggle buttons, seek bars, edit boxes and several switch views. All of the views except the switch views retained their values after exiting the app with Activity.Finish and starting the app up again.
 

rleiman

Well-Known Member
Licensed User
Longtime User
The correct code is:
B4X:
  Else If GetType(v) = "android.widget.Switch" Then
     Dim jo As JavaObject = v
     data = Array(jo.RunMethod("isChecked", Null))
Hi Erel,

Perfect!

I don't know how the code works but it saved all of the states in the SwitchView views.

Thanks so much for your time and help. :p
 
Upvote 0
Top