public class MCQSample extends Activity implements OnClickListener{
TextView title;
String gotBread;
RadioGroup AnswerRG;
int value ;
int value1;
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.mcqsample);
title = (TextView) findViewById(R.id.abc);
nextP = (Button) findViewById(R.id.nextP);
backP = (Button) findViewById(R.id.backP);
AnswerRG = (RadioGroup) findViewById(R.id.AnswerRG);
Bundle b = getIntent().getExtras();
value = b.getInt("key", 0);
}
}
大家好,我正在做 Android 应用程序并坚持创建动态单选按钮。因为我不知道我需要多少按钮(这取决于值 - 用户输入)。我阅读了一些可以添加到布局中的帖子,但我想添加到 radioGroup 中。有什么办法吗?谢谢