嗨我正在做一個學校項目,我正在做一個性別分類。如果我選擇男性,男性圖標應加載到我的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
以上顯示 –