I dynamically created 3 buttons, but I can't access these buttons via the setOnClicklistener method.
My code is below:
quesButton = new Button[3];
ll1 = (LinearLayout) findViewById(R.id.ll4button);
for(int x=0; x<3; x++){
quesButton[x] = new Button(MainActivity.this);
quesButton[x].setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT));
quesButton[x].setText("Q" + (x + 1));
ll1.addView(quesButton[x]);
}
setOnClickListener... Share the rest of the relevant code please.