Hi everybody, this is my first appearance on this forum. I hope somebody can help me with this problem.
I have a simple layout with 9 buttons and 6 labels.
This subroutine executes without any error:
Sub cmbKnop2_Click
For Each lbl As Label In Activity
lbl.Color=Colors.Blue
Next
End Sub
But this very similar routine does not:
Sub cmbKnop1_Click
For Each btn As Button In Activity
btn.Color=Colors.Red
Next
End Sub
The code compiles ok. But after executing (and coloring all buttons red) it pauses at the highlighted line.
If i continue execution (using F5 in the Editor) an error is displayed on my Android device:
"An error has occurred in sub main_cmbknop1_click ()
btn.Color=Colors.Red
java.lang.ClassCastException: android.widget.TextView cannot be cast to android.widget.Button"
Has anybody an idea what causes this error?
Regards,
Se6astian
I have a simple layout with 9 buttons and 6 labels.
This subroutine executes without any error:
Sub cmbKnop2_Click
For Each lbl As Label In Activity
lbl.Color=Colors.Blue
Next
End Sub
But this very similar routine does not:
Sub cmbKnop1_Click
For Each btn As Button In Activity
btn.Color=Colors.Red
Next
End Sub
The code compiles ok. But after executing (and coloring all buttons red) it pauses at the highlighted line.
If i continue execution (using F5 in the Editor) an error is displayed on my Android device:
"An error has occurred in sub main_cmbknop1_click ()
btn.Color=Colors.Red
java.lang.ClassCastException: android.widget.TextView cannot be cast to android.widget.Button"
Has anybody an idea what causes this error?
Regards,
Se6astian