如何从适配器+数组重新加载listview

时间:2016-10-24 12:37:14

标签: android web-services

我正在制作一个Android应用程序,其中我使用了php webservices,其中我要删除数据,删除后值不刷新,我只是尝试adapter.notifyDataSetChanged()但仍然无法获得结果 这是我的代码请告诉我哪里错了。

    Delete.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {

            String Identifier_fev = null;
            String Default_Option = null;
            String Quantity1 = null;
            jffDatabase.open();
            Cursor identifie = jffDatabase.getALL();
            if (identifie.moveToPosition(position)) {
                Identifier_fev = identifie.getString(identifie.getColumnIndexOrThrow("identifier"));
               Default_Option = identifie.getString(identifie.getColumnIndexOrThrow("default_option"));
            }

             jffDatabase.delete(Identifier_fev, Default_Option);
            identifier.remove(position);
            title.remove(position);
           defaultPrice.remove(position);
            default_option.remove(position);
            price.remove(position);
            quantity.remove(position);


                Cursor c1 = jffDatabase.getALL();
                if (c1.moveToFirst()) {
                    do {
                        Quantity1 = c1.getString(c1.getColumnIndexOrThrow("quantity"));
                        update_quantity.add(Quantity1);

                    } while (c1.moveToNext());
                }
                    for (int i = 0; i < update_quantity.size(); i++) {
                        Toast.makeText(ctx, "" + update_quantity, Toast.LENGTH_LONG).show();

                      Quantitylbl.setText(update_quantity.get(i).toString());


                        Toast.makeText(ctx, "set " + Quantitylbl.getText().toString(), Toast.LENGTH_LONG).show();
                    }


            Quantity();
          AddtoCartActivity.Cartcount.setText(String.valueOf(sum));

        }

    });

0 个答案:

没有答案