AlertDialog에서 이용하기 위하여 ArrayList를 String[]로 변환하기
샘플 )ArrayList<String> arTemp = new ArrayList();
for(int i=0; i<arGugun.size(); i++){
HashMap hmUnit = (HashMap)arGugun.get(i);
String sUnitGugun = com.util.StringUtil.Nvl((String)hmUnit.get("gugun")); //
arTemp.add(sUnitGugun);
}
final String sUnitSido = etEnterRequestFormAddressSido.getText().toString();
final String[] items = arTemp.toArray(new String[arTemp.size()]);
AlertDialog.Builder alt_bld = new AlertDialog.Builder(actMain);
alt_bld.setCancelable(true);
alt_bld.setIcon(R.drawable.icon_start57);
alt_bld.setTitle("구군선택");
alt_bld.setSingleChoiceItems(items, -1, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int item) {
//actMain.alertCommonMsg(PhoneModels[item].toString());
etEnterRequestFormAddressGugun.setText(items[item].toString());
etEnterRequestFormAddress.setText(sUnitSido + " " + items[item].toString() + " ");
dialog.cancel();
}
});
AlertDialog alert = alt_bld.create();
alert.show();
샘플 _ 이미지보기 )
댓글 없음:
댓글 쓰기