I have a CardView in AndroidStudio with different ID's for each card. To search the different ID's i have made this:
for (int f = 0; f < mainGrid.getChildCount(); f++) {
if (f == count) {
int index = f;
String id = "food"+index;
foodName = findViewById(R.id.id);
foodName.getText();
}
}
But at foodName = findViewById(R.id.id);
says that "Cannot resolve symbol id"
There's any other way to do it?