안녕하세요
안드로이드에서 리스트뷰에 클릭한 아이템을 Hashmap으로 담아서 태그별로 스트링값을 가져와서 edittext에 표시하려는데 잘안됩니다.. 방법이 있을 까요??
setext가 안 되는것 같습니다.
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
hashMap_r = mArrayList.get(position);
for (int i = 0; i < hashMap_r.size(); i++) {
////* hwid =selected_Admin.getString(TAG_HwID);*//*
/* select_hwid = seleted_data[0];
select_auth = seleted_data[1];
select_part = seleted_data[2];
select_loc = seleted_data[3];*/
select_hwid = hashMap_r.get(TAG_HwID);
select_auth = hashMap_r.get("auth");
select_part = hashMap_r.get(TAG_Part);
select_loc = hashMap_r.get(TAG_Loc);
}
update(select_hwid,select_auth,select_part,select_loc);
isChecked=false;
}
void update(String select_hwid, String select_auth, String select_part,String select_loc) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("디바이스 수정");
builder.setMessage("디바이스 데이터를 수정하세요.");
//builder.setMessage((CharSequence) vo).show();
LayoutInflater inflater = getLayoutInflater();
View view = inflater.inflate(R.layout.update_device, null);
builder.setView(view);
final Button update = (Button) view.findViewById(R.id.w_update);
final Button cancel = (Button) view.findViewById(R.id.w_cancel);
final Button delete = (Button) view.findViewById(R.id.w_del);
HID = (EditText) view.findViewById(R.id.w_hwid);
Auth = (EditText) view.findViewById(R.id.w_auth);
part = (EditText) view.findViewById(R.id.w_part);
loc = (EditText) view.findViewById(R.id.w_loc);
/*HID.invalidate();
Auth.invalidate();
part.invalidate();
loc.invalidate();*/
final AlertDialog dialog = builder.create();
update.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
/*
//안됨
HID.setText(select_hwid);
Auth.setText(select_auth);
part.setText(select_part);
loc.setText(select_loc); */
//안됨
HID.setText(HID.getText() + select_hwid);
Auth.setText(Auth.getText() + select_auth);
part.setText(part.getText() + select_part);
loc.setText(loc.getText() + select_loc);
System.out.println("update read data"+select_hwid+"/"+ select_auth +""+ select_part +"/"+ select_loc);
System.out.println("update read data"+HID+"/"+Auth+""+part+"/"+loc);