0

私はテキストビューを含むリストを持っています。多くのデータがリストに流れており、xmlに1つのテキストビューがあります....問題は、リスト内のすべてのテキストビューエントリを更新したい..(TAG_QTY)のテキストビューを更新したいです値を入力するたびに一覧表示...

ListAdapter adapter = new SimpleAdapter(this, contactList,
            R.layout.list_item,
            new String[] { TAG_BARCODE, TAG_DIVISION, TAG_MRP,TAG_QTY}, new int[] {
                    R.id.txt, R.id.txt1, R.id.mrp,R.id.qty1 });
    setListAdapter(adapter);
    // selecting single ListView item
    ListView lv = getListView();

    lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
    @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {

            //String name = ((TextView) view.findViewById(R.id.qty1)).getText().toString();
            LayoutInflater li = LayoutInflater.from(context);
            View promptsView = li.inflate(R.layout.prompts, null);
            //final View textEntryView;

            AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
                    context);

            // set prompts.xml to alertdialog builder
            alertDialogBuilder.setView(promptsView);
            fourth = (TextView)findViewById(R.id.qty1);
            userInput = (EditText)promptsView.findViewById(R.id.editTextDialogUserInput);
            //String ed = userInput.getText().toString();
          //final int ed= Integer.parseInt(userInput.getText().toString());
            alertDialogBuilder
                    .setCancelable(false)
                    .setPositiveButton("OK",
                            new DialogInterface.OnClickListener() {
                                public void onClick(DialogInterface dialog,int id) {
                                    String ed = userInput.getText().toString().trim();
                                    fourth.setText(ed);
                             }
                            })
                    .setNegativeButton("Cancel",
                            new DialogInterface.OnClickListener() {
                                public void onClick(DialogInterface dialog,int id) {
                                    dialog.cancel();
                                }
                            });

            // create alert dialog
            AlertDialog alertDialog = alertDialogBuilder.create();
            alertDialog.show();

        }
    }
    );
4

1 に答える 1