public <T> void addToRequestQueue(Request<T> req, String tag) {
    // set the default tag if tag is empty
    req.setTag(TextUtils.isEmpty(tag) ? "TAG" : tag);

    VolleyLog.d("Adding request to queue: %s", req.getUrl());

    getRequestQueue().add(req);
  }
  private void addToRequestQueue(Request req, String tag) {
    if (null == tag) {
      tag = requestUrlToTag.get(req.getUrl());
      if (null == tag) {
        tag = HackApplication.randomString.nextString();
        requestUrlToTag.put(req.getUrl(), tag);
      }
      req.setTag(tag);
    } else {
      req.setTag(tag);
    }

    cancelFromRequestQueue(req, tag);
    Log.e(TAG, "URL: -> " + req.getUrl());

    makaanGetRequestQueue.add(req);
  }
  public static void addRequest(Request<?> request, Object tag) {
    if (tag != null) {
      request.setTag(tag);
    }
    mRequestQueue.add(request);

    //		Logger.d("addRequest = " + request.getUrl());

  }
 public <T> void addToRequestQueue(Request<T> req) {
   req.setTag(TAG);
   req.setRetryPolicy(
       new DefaultRetryPolicy(
           DefaultRetryPolicy.DEFAULT_TIMEOUT_MS * 2,
           DefaultRetryPolicy.DEFAULT_MAX_RETRIES,
           DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));
   getRequestQueue().add(req);
 }
 public void addToQueue(Request request) {
   if (request != null) {
     request.setTag(this);
     if (fRequestQueue == null) fRequestQueue = volley.getRequestQueue();
     request.setRetryPolicy(
         new DefaultRetryPolicy(60000, 3, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));
     onPreStartConnection();
     fRequestQueue.add(request);
   }
 }
Example #6
0
 public static void searchTweet(Context context, String pUrl, NetworkCallback callback) {
   StringBuilder url = new StringBuilder(pUrl);
   url.append("&count=" + DEFAULT_PAGE_SIZE);
   Request<String> volleyTypeRequest = null;
   volleyTypeRequest =
       bundleToVolleyRequestWithSoftTtl(
           context, Request.Method.GET, null, url.toString(), callback);
   volleyTypeRequest.setTag(callback);
   volleyTypeRequest.setShouldCache(true);
   dispatchToQueue(volleyTypeRequest, context);
 }
Example #7
0
 public static <T> void addRequest(RequestQueue requestQueue, Request<T> request, Object tag) {
   if (tag != null) {
     request.setTag(tag);
   }
   request.setShouldCache(false);
   request.setRetryPolicy(
       new DefaultRetryPolicy(
           TIME_OUT,
           DefaultRetryPolicy.DEFAULT_MAX_RETRIES,
           DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));
   requestQueue.add(request);
 }
Example #8
0
 public <T> void addToRequestQueue(Request<T> req, String tag) {
   req.setTag(TextUtils.isEmpty(tag) ? TAG : tag);
   getRequestQueue().add(req);
 }
Example #9
0
 public <T> void addToRequestQueue(Request<T> req, String tag) {
   // set the default tag if tag is empty
   req.setTag(TextUtils.isEmpty(tag) ? TAG : tag);
   getRequestQueue().add(req);
 }
 public void submitNetworkRequest(String requestTag, Request request) {
   requestQueue.cancelAll(requestTag);
   requestQueue.add(request);
   request.setTag(requestTag);
 }
Example #11
0
 /**
  * @param request 请求
  * @param tag 上下文
  */
 public static void addRequest(Request<?> request, Object tag) {
   if (tag != null) {
     request.setTag(tag);
   }
   mRequestQueue.add(request);
 }
Example #12
0
  /**
   * Adds the specified request to the global queue using the Default TAG.
   *
   * @param req
   */
  public <T> void addToRequestQueue(Request<T> req) {
    // set the default tag if tag is empty
    req.setTag(TAG);

    getRequestQueue().add(req);
  }
Example #13
0
 public static <T> Request<T> startRequest(Request<T> paramRequest, Object paramObject) {
   paramRequest.setTag(paramObject);
   Request localRequest = queue.add(paramRequest);
   queue.start();
   return localRequest;
 }
Example #14
0
 public void addRequest(Request request, Object tag) {
   request.setTag(tag);
   RequestManager.getInstance(getActivity()).addRequest(request);
 }
Example #15
0
 public <T> void addToRequestQueue(Request<T> req) {
   req.setTag(TAG);
   getRequestQueue().add(req);
 }
Example #16
0
 private static void addToRequestQueue(Object tag, Request request) {
   if (tag != null) {
     request.setTag(tag);
   }
   requestQueue.add(request);
 }
 public void addToRequestQueue(Request request, String tag) {
   request.setTag(TextUtils.isEmpty(tag) ? TAG : tag);
   getRequestQueue().add(request);
 }