I'm trying to port a project I did in JavaScript to Java (Android), and I'm having trouble figuring out how to do certain things in Java and Android Studio that were different in JS. Right now I'm trying to figure out how to do this fix I had in the original JS program that took advantage of the naming convention I used to let me loop through each text label.
for(var i = 0; i <= 5; i++)
{
for(var j = 0; j <= 5; j++)
{
setText("lbl" + i + j, text);
}
}
If I had label00 - label12, this could loop through all of them and set text accordingly, but I don't know how to adapt this to the setText method in Android Studio.I wanted to try something like this, but it's saying "Identifier Expected" where the findViewById command has quotes after the second period.
TextView lblID = (TextView) findViewById(R.id."lbl" + i + j);
lblID.setTextColor(Color.parseColor("#186cb3"));
Most of the UI control was based on this principal, so I need something similar if I can't get this working.
javaorjavascript? They are about as similar asAustriaandAustralia.int j= 0;not 'var j = 0;'