我在我的应用程序中添加了一个按钮
LayoutParams lpView = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
Button btn = new Button(this);
btn.setText("Button");
linLayout.addView(btn, lpView);
但实际上我不知道我会有多少按钮,如何循环生成它。我的意思是,如何使用不同的名称:
Button btn1 = new Button(this);
Button btn2 = new Button(this); Button
btn3 = new Button(this);