private void cancelFromRequestQueue(Request req, String tag) {
   if (null != makaanGetRequestQueue) {
     if (tag == null && null != req) {
       tag = requestUrlToTag.get(req.getUrl());
       makaanGetRequestQueue.cancelAll(tag);
     } else if (null != tag) {
       makaanGetRequestQueue.cancelAll(tag);
     }
   }
 }
 @Override
 public void onDetach() {
   // TODO Auto-generated method stub
   Log.i("OnDetach", "leaving this fragment");
   mRequestQueue.cancelAll(REQUEST_TAG);
   super.onDetach();
 }
示例#3
0
 public static void cancelAllByTag(Object tag) {
   if (null != requestQueue) {
     if (tag != null) {
       requestQueue.cancelAll(tag);
     }
   }
 }
示例#4
0
 /** ˙ 取消全部请求 */
 public static void cancelAll() {
   requestQueue.cancelAll(
       new RequestQueue.RequestFilter() {
         @Override
         public boolean apply(Request<?> request) {
           return true;
         }
       });
 }
 @Override
 public void onPause() {
   super.onPause();
   if (DEBUG) {
     Log.v(LOG_TAG, "onPause():");
   }
   ((MainActivity) getActivity()).hideSearchMenuItem();
   mRequestQueue.cancelAll(REQUEST_TAG);
 }
  @Override
  protected void onStop() {
    // Disconnecting the client invalidates it.
    mGoogleApiClient.disconnect();
    super.onStop();

    if (mQueue != null) {
      mQueue.cancelAll(REQUEST_TAG);
    }
  }
示例#7
0
 /**
  * Cancels all requests in this queue with the given tag. Tag must be non-null and equality is by
  * identity.
  *
  * <p>tag 表示按照Request.setTag设置好的 tag 取消请求,比如同属于某个 Activity 的。
  */
 public void cancelAll(final Object tag) {
   if (tag == null) {
     throw new IllegalArgumentException("Cannot cancelAll with a null tag");
   }
   cancelAll(
       new RequestFilter() {
         @Override
         public boolean apply(Request<?> request) {
           return request.getTag() == tag;
         }
       });
 }
  @Override
  public void onStop() {
    super.onStop();

    if (queue != null) {
      queue.cancelAll(TAG);
    }

    if (refreshLayout.isRefreshing()) {
      refreshLayout.post(
          new Runnable() {
            @Override
            public void run() {
              refreshLayout.setRefreshing(false);
            }
          });
    }
  }
 @Override
 public void onDismiss(DialogInterface dialog) {
   requestQueue.cancelAll(this);
   currencyPairsMapHelper = null;
 }
示例#10
0
 public static void cancelRequest(Object tag) {
   requestQueue.cancelAll(tag);
 }
示例#11
0
 public void cancelPendingRequests(Object tag) {
   if (mRequestQueue != null) {
     mRequestQueue.cancelAll(tag);
   }
 }
示例#12
0
 public void cancelAll(Object tag) {
   mRequestQueue.cancelAll(tag);
 }
 /** アプリが終了した時の処理 */
 @Override
 public void onStop() {
   super.onStop();
   Log.d(TAG, "Activity-onStop");
   mQueue.cancelAll(this);
 }
示例#14
0
 public static void camcelRequest(Object paramObject) {
   queue.cancelAll(paramObject);
 }
 public void submitNetworkRequest(String requestTag, Request request) {
   requestQueue.cancelAll(requestTag);
   requestQueue.add(request);
   request.setTag(requestTag);
 }
 public void cancelPendingRequests(Object tag) {
   AppLog.v(LOG_TAG, "in cancelPendingRequests() of volley tag:" + tag);
   if (mRequestQueue != null) {
     mRequestQueue.cancelAll(tag);
   }
 }
示例#17
0
 public static void cancelAll(Context context) {
   if (null != requestQueue) {
     requestQueue.cancelAll(context);
   }
 }
示例#18
0
 public void cancelAllRequests(final String tag) {
   mRequestQueue.cancelAll(tag);
 }
 @Override
 public void onStop() {
   super.onStop();
   mRequestQueue.cancelAll(TAG);
 }