1
自分のラジオボタンを使用しようとしても、グループに含まれているため、一度に1つしか選択できませんが、選択肢を選択してその代わりに送信したAndroidラジオボタン
testRm.setOnClickListener(new Button.OnClickListener(
) {
@Override
public void onClick(View v) {
setReminder();
displayToast("Test");
}
});
setReminder方法
public void setReminder() {
onewk = (RadioButton) findViewById(R.id.radioButton);
twowk = (RadioButton) findViewById(R.id.radioButton2);
onemnt = (RadioButton) findViewById(R.id.radioButton3);
mag = (RadioButton) findViewById(R.id.radioButton4);
twoprt = (RadioButton) findViewById(R.id.radioButton5);
if(onewk.isSelected()) {
scheduleNotification(getNotification("1 Week"), 7);
}
if(twowk.isSelected()) {
scheduleNotification(getNotification("2 Weeks"), 14);
}
if(onemnt.isSelected()) {
scheduleNotification(getNotification("1 Month"), 30);
}
if(mag.isSelected()) {
scheduleNotification(getNotification("Test 1"), 30);
}
if(twoprt.isSelected()) {
scheduleNotification(getNotification("Test 2"), 1);
}
}
トースト方法
を:ボタンは、結果を収集し、この正しいメソッドを呼び出す提出することは、私がこれまで持っているものです私はオンラインで見つけることができる唯一の例は、onEventメソッドでswitch文を使用しているため、他の何かを試していましたが、scheduleNotificationメソッドが呼び出されないので、悲惨に失敗しました。