//simple_list_item_single_choice
private void selectAlert() {
String[] items = { "男", "女" };
ListView lv = new ListView(this);
// アダプタの作成
lv.setAdapter(new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_single_choice, items));
lv.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
AlertDialog.Builder ab = new AlertDialog.Builder(this);
ab.setView(lv);
ab.setNegativeButton("cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
});
ab.show();
lv.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> list, View view, int iposition,
long id) {
}
});
}