Android Question trying to change the text of a swiftbutton , type is not compatible error?????

omarruben

Active Member
Licensed User
Hi, i have this code of a bunch of swiftbuttons and want to change the text of each via foreach, but a get an error:

B4X:
Private btn1 As SwiftButton
    Private btn2 As SwiftButton
    Private btn3 As SwiftButton
    Private btn4 As SwiftButton
    Private btn5 As SwiftButton
    Private btn6 As SwiftButton

For Each anotation  As SwiftButton In Array(btn1,btn2,btn3,btn4,btn5,btn6)
        anotation.mBase.Text = ""
    Next
ERROR:
java.lang.RuntimeException: Type does not match (class anywheresoftware.b4a.BALayout)
.......
.......
 
Top