I'm trying to create a button array, where the number of buttons depends on the length of a char array.
This is my code:
But it leads to errors. I can't find out to make button arrays properly in android. Any help?
This is my code:
Code:
int k = 0;
Button[] btnarray = new Button[new_word_array.length];
while (k<new_word_array.length){
k++;
btnarray[k] = new Button(this);
layout.addView(btnarray[k]);
}
But it leads to errors. I can't find out to make button arrays properly in android. Any help?