Why is this code wrong? It doesn't accept the setText function on a button.
findViewById(getResources().getIdentifier("button" + Integer.toString(i), "id", getPackageName()))
.setText("abc");
But if I write like this
button1.setText("abc");
it is ok.
You can accept one answer (if it helps you) by click on big gray check button on its left side. If you wish you can add +10 points to any author of any good answer by click upper gray triangle