Android Question using a variable to access a view

clydebamford

Member
Licensed User
I have many checkbox views in designer that I would like to access with code and it would be trivial if I could use a variable in a for loop to change their text color or similar property
ie cb1, cb2, cb3 could be accessed easily in a for loop rather than repeating the code addnausium for each checkbox, does that make sense?
 

Cableguy

Expert
Licensed User
Add the views to a list if you are adding them in the designer or if you are adding them in code, just array them

B4X:
 dim checkbox(10) as checkbox

For n = 0 to checkbox ().lenght -1
Checkbox(n).checked = False
Next
 
Top