You don't need an array to identify the buttons. Use an array to identify just the buttons that was pressed.
If your button contains the letter as a text...:
<Button
android:id="@+id/alef_button"
...
android:text="?" />
<Button
android:id="@+id/bet_button"
...
android:text="?" />
Then you can use the same method as a listener for all buttons:
public void onButtonClick(View view) {
Button pressedButton = (Button) view;
if("?".equals(pressedButton.getText())) {
putOnArray("alef");
} else if("?".equals(pressedButton.getText())) {
putOnArray("bet");
} ...
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…