마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

안드로이드 Editext에 특정 스트링값을 디스플레이하는법(edit을 위해)

0 추천

안녕하세요

안드로이드에서 리스트뷰에 클릭한 아이템을 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);

 

익명사용자 님이 2018년 8월 29일 질문

답변 달기

· 글에 소스 코드 보기 좋게 넣는 법
· 질문에 대해 추가적인 질문이나 의견이 있으면 답변이 아니라 댓글로 달아주시기 바랍니다.
표시할 이름 (옵션):
개인정보: 당신의 이메일은 이 알림을 보내는데만 사용됩니다.
스팸 차단 검사:
스팸 검사를 다시 받지 않으려면 로그인하거나 혹은 가입 하세요.
...