I want to realize app which will have few slides. How to do it I’ve understood. Now On first page I have created two buttons.
First button means that next slide by clicking flipper forward will play mp3 file with MAN’s voice.
Second button means that next slide by clicking flipper forward will play mp3 file with WOMAN’s voice…
myOption1 = (RadioButton)findViewById(R.id.option1);
myOption2 = (RadioButton)findViewById(R.id.option2);
myOption1.setOnClickListener(myOptionOnClickListener);
myOption2.setOnClickListener(myOptionOnClickListener);
myOption1.setChecked(true);
myOption2.setChecked(false);
…
RadioButton.OnClickListener myOptionOnClickListener =
new RadioButton.OnClickListener(){
@Override
public void onClick(View vmw) {
// TODO Auto-generated method stub
if (myOption2.isChecked()== true){
myOption1.setChecked(false);
myOption1.isClickable();
Toast.makeText(Main.this,
"Option 1 : " + myOption1.isChecked() + "\n"+
"Option 2 : " + myOption2.isChecked(),
Toast.LENGTH_LONG).show();
}else {
myOption1.setChecked(true);
myOption2.setChecked(false);
Toast.makeText(Main.this,
"Option 1 : " + myOption1.isChecked() + "\n"+
"Option 2 : " + myOption2.isChecked(),
Toast.LENGTH_LONG).show();
}
return;
- OnclickListener changes bool when click second button, but when press ferst button for man’s voice – nothing changes!!! Option2 becomes true, but it must become false if I check first button…((((
2.How can I get result of this choice on the next
In onClick(View vmw) use the vmw(view) to get myOptions(RadioButton) like :
then check the conditions. Please try this and reply.