嗨我正在做一个学校项目,我正在做一个性别分类。如果我选择男性,男性图标应加载到我的android应用程序中的imageView和Vice Versa。如何选择单选按钮将图像加载到imageView
public static TextView lable5,lable7;
public static SeekBar SB1,SB2;
public static RadioButton RB1,RB2;
public static ImageView IV1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_layout);
lable5 = (TextView) findViewById(R.id.textView5); //this is for seekbar1
lable7 = (TextView) findViewById(R.id.textView7); //This is for seekbar2
RB1 = (RadioButton) findViewById(R.id.radioButton1); // This is for male option
RB2 = (RadioButton) findViewById(R.id.radioButton2); // This is for Female Option
IV1 = (ImageView) findViewById(R.id.imageView); // This is the only imageView available
SB1=(SeekBar) findViewById(R.id.seekBar1);// This is for seekBar1
SB2=(SeekBar) findViewById(R.id.seekBar2);//This is for seekBar2
lable5.setText(String.valueOf(SB1.getProgress()));
}
你到目前为止做了什么?告诉我们你的代码。 – SripadRaj
欢迎来到StackOverflow。请阅读[如何提出一个好问题。](http://stackoverflow.com/help/how-to-ask)并注意:Java和JavaScript是独立的语言。 – nnnnnn
以上显示 –