[Solved] ANDROID: How can I set up buttons in a for loop?


You do not need to do anything in the XML file. This can all be done in a class.

for(int i=0; i < x; i++) // where x is the size of the list containing your alphabet.
{
   Button button = new Button(this);
   button.setId(i);
   yourView.add(button);
}

1

solved ANDROID: How can I set up buttons in a for loop?