Esempio n. 1
0
  public void requestCancelGift(final GiftHistoryItem item) {
    List<NameValuePair> nameValuePairs = ParameterFactory.requestCancelGift(item.getTxnId());
    AsyncHttpPost postGetGiftList =
        new AsyncHttpPost(
            getActivity(),
            new AsyncHttpResponseProcess(getActivity()) {
              @Override
              public void processIfResponseSuccess(String response) {
                try {
                  JSONObject jsonObject = new JSONObject(response);
                  //							log.m(">>>>>>>>>>>>> " + response);
                  DialogUtility.alert(getActivity(), "Hủy quà thành công");
                  data.remove(item);
                  setData(data);
                } catch (JSONException e) {
                  // TODO Auto-generated catch block
                  e.printStackTrace();
                  DialogUtility.alert(getActivity(), "Hủy quà thất bại");
                }
              }

              @Override
              public void processIfResponseFail() {
                log.e("failed ", "failed");
              }
            },
            nameValuePairs,
            true);
    postGetGiftList.execute(WebServiceConfig.URL_REQUEST_CANCEL_GIFT);
  }