Get the position of a spinner in Android

前端 未结 4 1332
醉梦人生
醉梦人生 2020-12-14 06:07

I\'m trying to get the position (number) of the spinner when selected to use it in another Activity that will display a different map each time depending on the item selecte

4条回答
  •  萌比男神i
    2020-12-14 06:22

    if (position ==0) {
        if (rYes.isChecked()) {
            Toast.makeText(SportActivity.this, "yes ur answer is right", Toast.LENGTH_LONG).show();
        } else if (rNo.isChecked()) {
            Toast.makeText(SportActivity.this, "no.ur answer is wrong", Toast.LENGTH_LONG).show();
        }
    }
    

    This code is supposed to select both check boxes.
    Is there a problem with it?

提交回复
热议问题