当前位置: 首页>>代码示例>>Java>>正文


Java RequestFilter类代码示例

本文整理汇总了Java中com.android.volley.RequestQueue.RequestFilter的典型用法代码示例。如果您正苦于以下问题:Java RequestFilter类的具体用法?Java RequestFilter怎么用?Java RequestFilter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


RequestFilter类属于com.android.volley.RequestQueue包,在下文中一共展示了RequestFilter类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: drain

import com.android.volley.RequestQueue.RequestFilter; //导入依赖的package包/类
private static void drain(RequestQueue paramRequestQueue, int paramInt)
{
  paramRequestQueue.cancelAll(new RequestQueue.RequestFilter()
  {
    public final boolean apply(Request<?> paramAnonymousRequest)
    {
      if ((paramAnonymousRequest instanceof DfeRequest))
      {
        if (((DfeRequest)paramAnonymousRequest).mAvoidBulkCancel) {
          return false;
        }
      }
      else if ((paramAnonymousRequest instanceof VendingRequest))
      {
        if (((VendingRequest)paramAnonymousRequest).mAvoidBulkCancel) {
          return false;
        }
      }
      else if ((paramAnonymousRequest instanceof EscrowRequest)) {
        return false;
      }
      return paramAnonymousRequest.getSequence() < this.val$seq;
    }
  });
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:26,代码来源:FinskyApp.java

示例2: cancel

import com.android.volley.RequestQueue.RequestFilter; //导入依赖的package包/类
/**
 * 取消
 * @param method
 * @param api
 * @param urlParams
 * @param params
 */
public void cancel(final int method,
                   final int api,
                   final Object[] urlParams,
                   final Map<String, String> params) {
    final String targetUrl = buildUrl(method, api, urlParams, params);
    mRequestQueue.cancelAll(new RequestFilter() {
        @Override
        public boolean apply(Request<?> request) {
            return String.valueOf(request.getTag()) == targetUrl;
        }
    });
}
 
开发者ID:HanyeeWang,项目名称:GeekZone,代码行数:20,代码来源:BaseAPIHelper.java

示例3: cancelAllRequest

import com.android.volley.RequestQueue.RequestFilter; //导入依赖的package包/类
/**
 * 取消所有请求.
 */
public void cancelAllRequest() {
    if (mRequestQueue != null) mRequestQueue.cancelAll(new RequestFilter() {
        @Override
        public boolean apply(Request<?> request) {
            return true;
        }
    });
}
 
开发者ID:tengbinlive,项目名称:ooooim_android,代码行数:12,代码来源:CommonDataLoader.java

示例4: onDetach

import com.android.volley.RequestQueue.RequestFilter; //导入依赖的package包/类
public final void onDetach()
{
  super.onDetach();
  this.mOnRegionCodeSelectedListener = null;
  cancelPendingAdminAreaMetadataRetrievalRequest();
  getRequestQueue().cancelAll(new RequestQueue.RequestFilter()
  {
    public final boolean apply(Request<?> paramAnonymousRequest)
    {
      return paramAnonymousRequest instanceof CountryMetadataRetrievalTask.CountryMetadataRetrievalRequest;
    }
  });
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:14,代码来源:AddressEntryFragment.java

示例5: clearRefreshQueue

import com.android.volley.RequestQueue.RequestFilter; //导入依赖的package包/类
protected synchronized void clearRefreshQueue() {
    volleyRefreshQueue.cancelAll(new RequestFilter() {
        @Override
        public boolean apply(com.android.volley.Request<?> request) {
            return true;
        }
    });
}
 
开发者ID:podio,项目名称:podio-android,代码行数:9,代码来源:VolleyClient.java

示例6: clearRequestQueue

import com.android.volley.RequestQueue.RequestFilter; //导入依赖的package包/类
protected synchronized void clearRequestQueue() {
    volleyRequestQueue.cancelAll(new RequestFilter() {
        @Override
        public boolean apply(com.android.volley.Request<?> request) {
            return true;
        }
    });
}
 
开发者ID:podio,项目名称:podio-android,代码行数:9,代码来源:VolleyClient.java

示例7: cancelVolleyRquestByObject

import com.android.volley.RequestQueue.RequestFilter; //导入依赖的package包/类
@Deprecated
public void cancelVolleyRquestByObject(final Object obj) {
    if (mVolleyQueue == null) {
        return;
    }
    mVolleyQueue.cancelAll(new RequestFilter() {
        @Override
        public boolean apply(Request<?> request) {
            if (request.getTag() != null && request.getTag() instanceof VolleyTag) {
                return ((VolleyTag) request.getTag()).object == obj;
            }
            return false;
        }
    });
}
 
开发者ID:hunatika615,项目名称:egg-android,代码行数:16,代码来源:EggTaskCentral.java

示例8: cancelVolleyRequestAll

import com.android.volley.RequestQueue.RequestFilter; //导入依赖的package包/类
@Deprecated
public void cancelVolleyRequestAll() {
    if (mVolleyQueue == null) {
        return;
    }
    mVolleyQueue.cancelAll(new RequestFilter() {
        @Override
        public boolean apply(Request<?> request) {
            return true;
        }
    });
}
 
开发者ID:hunatika615,项目名称:egg-android,代码行数:13,代码来源:EggTaskCentral.java

示例9: fetch

import com.android.volley.RequestQueue.RequestFilter; //导入依赖的package包/类
@Override
public void fetch(final VolleyNetworkFetchState fetchState, final Callback callback) {
  fetchState.submitTime = SystemClock.elapsedRealtime();

  final RawRequest request = new RawRequest(
      fetchState.getUri().toString(),
      new Response.Listener<byte[]>() {
        @Override
        public void onResponse(byte[] bytes) {
          fetchState.responseTime = SystemClock.uptimeMillis();

          try {
            InputStream is = new ByteArrayInputStream(bytes);
            callback.onResponse(is, bytes.length);
          } catch (IOException e) {
            callback.onFailure(e);
          }
        }
      },
      new Response.ErrorListener() {
        @Override
        public void onErrorResponse(VolleyError volleyError) {
          callback.onFailure(volleyError);
        }
      });

  fetchState.getContext().addCallbacks(
      new BaseProducerContextCallbacks() {
        @Override
        public void onCancellationRequested() {
          mRequestQueue.cancelAll(new RequestFilter() {
            @Override
            public boolean apply(Request<?> candidate) {
              return candidate != null && request.getSequence() == candidate.getSequence();
            }
          });
        }
      });

  mRequestQueue.add(request);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:42,代码来源:VolleyNetworkFetcher.java

示例10: cancelVolleyRequest

import com.android.volley.RequestQueue.RequestFilter; //导入依赖的package包/类
@Deprecated
public void cancelVolleyRequest(RequestFilter filter) {
    if (mVolleyQueue!=null) {
        mVolleyQueue.cancelAll(filter);
    }
}
 
开发者ID:hunatika615,项目名称:egg-android,代码行数:7,代码来源:EggTaskCentral.java

示例11: cancelRequestQueue

import com.android.volley.RequestQueue.RequestFilter; //导入依赖的package包/类
public void cancelRequestQueue(jp.egg.android.request2.okhttp.RequestQueue.RequestFilter filter) {
    if (mRequestQueue != null) {
        mRequestQueue.cancelAll(filter);
    }
}
 
开发者ID:hunatika615,项目名称:egg-android,代码行数:6,代码来源:EggTaskCentral.java

示例12: cancelAllRequest

import com.android.volley.RequestQueue.RequestFilter; //导入依赖的package包/类
public static void cancelAllRequest(RequestFilter filter){
    mQueue.cancelAll(filter);
}
 
开发者ID:yrom,项目名称:AcFun-Area63,代码行数:4,代码来源:AcApp.java


注:本文中的com.android.volley.RequestQueue.RequestFilter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。