@Override public boolean remove(Object o) { return jsonArray.remove(o); }
@Override public Object remove(int index) { return jsonArray.remove(index); }
@Override public boolean remove(Object o) { return jsonArray.remove(o); }
@Override public Object remove(int index) { return jsonArray.remove(index); }
throw new NullPointerException("PUT " + path + ", " + realKey + ":" + obj + " 不存在!"); targetArray.remove(obj);
@Override public Object remove(int index) { return jsonArray.remove(index); }
@Override public Object remove(int index) { return jsonArray.remove(index); }
@Override public boolean remove(Object o) { return jsonArray.remove(o); }
@Override public boolean remove(Object o) { return jsonArray.remove(o); }
/** * Remove an index and close the hole. * @param index The index of the element to be removed. * @return The value that was associated with the index, * or null if there was no value. */ public Object remove(int index) { Object o = this.opt(index); _inner.remove(index); return o; }
@Override public void run() { boolean isChange = false; try { JSONObject jsonObject = JSONObject.parseObject(groupName); JSONArray jsonArray = jsonObject.getJSONArray("jsonArray"); for (int i = 0; i < jsonArray.size(); i++) { JSONObject userJson = jsonArray.getJSONObject(i); if (hxid.equals(userJson.getString("hxid"))) { jsonArray.remove(userJson); isChange = true; } } if (isChange) { jsonObject.put("jsonArray", jsonArray); Message message = hanlder.obtainMessage(); Bundle bundle = new Bundle(); bundle.putString("groupId", groupId); bundle.putString("groupName", jsonObject.toJSONString()); message.setData(bundle); message.what = UPDATE_GROUP_NAME; message.sendToTarget(); } } catch (JSONException e) { e.printStackTrace(); } } }).start();
cjsons.remove(postion); setCommentTextClick(ctextView, cjsons, view, goodSize);
private void deleteComment(String userID, final int postion, String scID, int type, TextView ctextView, final JSONArray cjsons, View view, int goodSize) { if (scID == null) { scID = "LOCAL"; } ; String tag = cjsons.getJSONObject(postion).getString("tag"); if (tag == null) { tag = String.valueOf(System.currentTimeMillis()); } // 更新UI cjsons.remove(postion); setCommentTextClick(ctextView, cjsons, view, goodSize); List<Param> params = new ArrayList<Param>(); params.add(new Param("scID", scID)); params.add(new Param("userID", myuserID)); params.add(new Param("tag", tag)); OkHttpManager.getInstance().post(params, FXConstant.URL_SOCIAL_DELETE_COMMENT, new OkHttpManager.HttpCallBack() { @Override public void onResponse(JSONObject jsonObject) { } @Override public void onFailure(String errorMsg) { } }); }
/** * 取消点赞 */ public void cancelGood(String sID, TextView tv_good, JSONArray jsons, LinearLayout ll_goodmembers_temp, View view, int cSize) { // 即时改变当前UI for (int i = 0; i < jsons.size(); i++) { JSONObject json = jsons.getJSONObject(i); if (json.getString("userID").equals(myuserID)) { jsons.remove(i); } } setGoodTextClick(tv_good, jsons, ll_goodmembers_temp, view, cSize); List<Param> params = new ArrayList<Param>(); params.add(new Param("sID", sID)); params.add(new Param("userID", myuserID)); OkHttpManager.getInstance().post(params, FXConstant.URL_SOCIAL_GOOD_CANCEL, new OkHttpManager.HttpCallBack() { @Override public void onResponse(JSONObject jsonObject) { } @Override public void onFailure(String errorMsg) { } }); }
cjsons.remove(postion); setCommentTextClick(ctextView, cjsons, view, goodSize);
/** * 取消点赞 */ public void cancelGood(String sID, TextView tv_good, JSONArray jsons, LinearLayout ll_goodmembers_temp, View view, int cSize) { // 即时改变当前UI for (int i = 0; i < jsons.size(); i++) { JSONObject json = jsons.getJSONObject(i); if (json.getString("userID").equals(myuserID)) { jsons.remove(i); } } setGoodTextClick(tv_good, jsons, ll_goodmembers_temp, view, cSize); List<Param> paramList = new ArrayList<>(); paramList.add(new Param("sID", sID)); paramList.add(new Param("userID", myuserID)); OkHttpManager.getInstance().post(paramList, FXConstant.URL_SOCIAL_GOOD_CANCEL, new OkHttpManager.HttpCallBack() { @Override public void onResponse(JSONObject jsonObject) { int code = jsonObject.getInteger("code"); if (code != 1000) { Toast.makeText(getApplicationContext(), getString(R.string.service_not_response), Toast.LENGTH_SHORT).show(); } } @Override public void onFailure(String errorMsg) { Toast.makeText(getApplicationContext(), getString(R.string.service_not_response), Toast.LENGTH_SHORT).show(); } }); }
JSONObject json = jsons.getJSONObject(i); if (json.getString("userID").equals(myuserID)) { jsons.remove(i);
jsonArray.remove(jsonObject1);