我想在第二个单选按钮 B 下面居中添加一个按钮,并且当我选择一个选项并单击验证时,会发生某些操作。有什么帮助吗?
final CharSequence[] photo = {"A","B"};
AlertDialog.Builder alert = new AlertDialog.Builder(this);
alert.setTitle("Select Gender");
alert.setSingleChoiceItems(photo,-1, new
DialogInterface.OnClickListener()
{
@Override
public void onClick(DialogInterface dialog, int which)
{
if(photo[which]=="A")
{
gen="B";
}
else if (photo[which]=="B")
{
gen="B";
}
}
});
alert.show();