Android中有沒有一種方法可以根據環境變量設置顯示一個已經選擇單選按鈕的對話框?有對話框的Android對話框
我寫了下面的代碼。它似乎並沒有什麼錯誤,我敢肯定它執行,但顯示的對話框時,沒有一個單選按鈕被選中:
switch (shape)
{
case SQUARE:
bigCircle.setSelected (false);
smSircle.setSelected (false);
if (size == BIG)
{
bigSquare.setSelected (true);
smSquare.setSelected (false);
}
else
{
bigSquare.setSelected (false);
smSquare.setSelected (true);
}
break;
case CIRCLE:
bigSquare.setSelected (false);
smSquare.setSelected (false);
if (size == BIG)
{
bigCircle.setSelected (true);
smCircle.setSelected (false);
}
else
{
bigCircle.setSelected (false);
smCircle.setSelected (true);
}
}
dialog.show();
任何建議?
感謝,
R.