Android Question FaceOffToggleButton


Licensed User
hello all....
i used FaceOffToggleButton in my layout
when tried to get the layout panel with th statement
    Dim index As Int = CustomListView1.GetItemFromView(Sender)
        Dim p As Panel
        p = CustomListView1.GetPanel(index)
it raises the following error
(ClassCastException) java.lang.ClassCastException: de.donmanfred.FaceOffToggleButtonWrapper$1 cannot be cast to android.view.View,,
any help؟؟


Active Member
Licensed User
Longtime User
Try casting the Sender to FaceOffToggleButton. Use the Parent property to get the containing panel. Can you use this panel?
Dim index As Int = CustomListView1.GetItemFromView(ParentPanel)
Upvote 0


Licensed User
Longtime User
i have CLV in each cell panel of it there is 2 B4XSwitchAcc
how change value of the B4XSwitchAcc1.value in specified CLV cell?
Let me see if I can understand your pos after spending some time reading it over and over:
You have a CLV that has items and each item is populated with two B4XSwitches. One B4XSwitchACC1 and the other B4XSwitchACC2. You want to scroll to any CLV panel and click on either B4XSwitches to change its state (value) from True to False or vice versa. You want the B4XSwitch_ValueChanged to tell you which of the two was clicked (1 or 2) and what the value is for the one you clicked (True or False). If this is what you want, I can help you. If not, it is best to post your code/project.
Upvote 0