我有这个代码:
if(ratingRB.isChecked() == true)
{
Toast.makeText(hotelSearch.this, "Please enter the rating as a word. (Ex. Five)", Toast.LENGTH_SHORT).show();
}
else
{
if(showAllRB.isChecked() == true)
{
nearest.setEnabled(true);
}
}
但是当我检查 2 个单选按钮(ratingRB、showAllRB)中的任何一个时,什么都没有发生。
nearest
是一个从一开始就被禁用的复选框,我希望当用户选择时showAllRB
,复选框被启用..怎么了?我该怎么办?