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);
 }
Пример #6
0
  @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;
         }
       });
 }
Пример #8
0
  @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);
 }
Пример #19
0
 @Override
 public void onStop() {
   super.onStop();
   mRequestQueue.cancelAll(TAG);
 }