我正在尝试更新解析中的数组值.Below是我为实现它而做的事情
for (int i=0;i<wishList.size();i++){
if (online2_g_s.getObjectId().equals(wishList.get(i))){
wishList.remove(i);
}
}
Log.i("sand",wishList.toString());
user.addAllUnique("wishList", Arrays.asList(wishList));
user.saveInBackground(new SaveCallback() {
@Override
public void done(ParseException e) {
if (e == null) {
Toast.makeText(context, "Item removed your WishList", Toast.LENGTH_SHORT).show();
}
}
});
其中wishlist是我的列表,我必须从中删除并更新其项目。 在运行这段代码之前,愿望清单是: [&#34; none&#34;,&#34; sandeep&#34;,&#34; 3sIgT00P5O&#34;,&#34; 6P5K609tpW&#34 ;,&#34; G5RmQ0S3kB&#34;]
运行这段代码之后,以下列表是:
[&#34;无&#34;&#34;和Sandeep&#34;&#34; 3sIgT00P5O&#34;&#34; 6P5K609tpW&#34;&#34; G5RmQ0S3kB&#34 ;,[&#34;无&#34;,&#34; sandeep&#34;,&#34; 3sIgT00P5O&#34;,&#34; 6P5K609tpW&#34;]] G5RmQ0S3kB已被删除
我想要实现的目标是 [&#34; none&#34;,&#34; sandeep&#34;,&#34; 3sIgT00P5O&#34;,&#34; 6P5K609tpW&#34;]