String[] single_list={"男","女"};
private void show1(){
AlertDialog.Builder builder=new AlertDialog.Builder(this);
builder.setTitle("选择性别!");
builder.setIcon(R.drawable.ic_launcher);
builder.setSingleChoiceItems(single_list,0,new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
String str=single_list[which];
Toast.makeText(MainActivity.this,"这个人是"+str,Toast.LENGTH_LONG).show();
}
});
AlertDialog dialog=builder.create();
dialog.show();
}