i have created a alertdialog with two radio buttons in it.when user select an option i need to dismiss the alertdialog but i am not been able to dismiss it.
final CharSequence[] items = {"First Option", "Second Option"};
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle("Choose an option");
builder.setSingleChoiceItems(items, -1, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int item) {
Toast.makeText(getApplicationContext(), items[item], Toast.LENGTH_SHORT).show();
}
});
final AlertDialog alert = builder.create();
alert.show();
能够帮助我如何做到这一点。
增 编