This is just a guess but you are not parsing your packId while re initializing your list after deleting one item.if(person.getString("responseCode").equals("1")){ JSONArray itemslist=person.optJSONArray("itemList"); if(itemslist==null) { Toast.makeText(BuyNowActivity.this, "Your Shopping Cart is Empty", Toast.LENGTH_SHORT).show(); } else { for (int j = 0; j < itemslist.length(); j++) { JSONObject cartitems = itemslist.getJSONObject(j); CartModel cvm = new CartModel(); cvm.setCart_Product_Name(cartitems.getString("prodNarration")); cvm.setCart_Product_Price(cartitems.getString("finalPrice")); cvm.setCart_Product_Id(cartitems.getString("productId")); cvm.setCart_Product_Img(cartitems.getString("packLink")); cvm.setCart_Product_Qty(cartitems.getString("qty")); cvm.setCart_Product_packDiscount(cartitems.getString("packDIscDesc")); // HERE add some code for parsing packId cartlist.add(cvm); } Toast.makeText(BuyNowActivity.this, "Product Removed Successfully", Toast.LENGTH_SHORT).show(); }}尝试在我添加评论的地方添加解析代码.Try adding the parsing code where i have added comment.希望这会对您有所帮助.Hope this will help you. 这篇关于带页脚的Recyclerview无法删除最后一个项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
06-26 19:28