我试图制作一系列按钮:

Button[] buttonlist = new Button[2];

Button btn1;
Button btn2;
Button btn3;
btn1 = (Button) findViewById(R.id.button1);
btn2 = (Button) findViewById(R.id.button2);
btn3 = (Button) findViewById(R.id.button3);

buttonlist[0] = btn1;
buttonlist[1] = btn2;
buttonlist[2] = btn3;


我在这里做错了什么?
谢谢 !

最佳答案

必须为Button[] buttonlist = new Button[3];

09-26 05:26