Pam.goudarzi
چهارشنبه 01 مرداد 1393, 11:02 صبح
سلام. من جدیدا دارم با RadioButton کار میکنم. میخواستم کاری کنم که فقط بشه یک رادیو باتن رو انتخاب کرد و اگه کاربر روی رادیوباتن بعدی کلیک کرد، رادیو باتن بعدی از حالت چک شده در بیاد. اما نمی دونم چجوری!!!
و یکی هم که میخوام عکس ImageView رو عوض کنم اما با هر دستوری که امتحان کردم نشد(Setimagedrawable و ...) کمکی می کنید؟
setContentView(R.layout.activity_main); final MediaPlayer mm = MediaPlayer.create(MainActivity.this, R.raw.pitch14);
RadioButton forteen = (RadioButton) findViewById(R.id.radioButton1);
RadioButton sixteen = (RadioButton) findViewById(R.id.radioButton2);
RadioButton twenty = (RadioButton) findViewById(R.id.radioButton3);
final ImageView anti = (ImageView) findViewById(R.id.imageView1);
if(forteen.isChecked()== true)
{
anti.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
mm.start();
}
});
و یکی هم که میخوام عکس ImageView رو عوض کنم اما با هر دستوری که امتحان کردم نشد(Setimagedrawable و ...) کمکی می کنید؟
setContentView(R.layout.activity_main); final MediaPlayer mm = MediaPlayer.create(MainActivity.this, R.raw.pitch14);
RadioButton forteen = (RadioButton) findViewById(R.id.radioButton1);
RadioButton sixteen = (RadioButton) findViewById(R.id.radioButton2);
RadioButton twenty = (RadioButton) findViewById(R.id.radioButton3);
final ImageView anti = (ImageView) findViewById(R.id.imageView1);
if(forteen.isChecked()== true)
{
anti.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
mm.start();
}
});