本文整理汇总了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;
}
});
}
示例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;
}
});
}
示例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;
}
});
}
示例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;
}
});
}
示例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;
}
});
}
示例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;
}
});
}
示例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;
}
});
}
示例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;
}
});
}
示例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);
}
示例10: cancelVolleyRequest
import com.android.volley.RequestQueue.RequestFilter; //导入依赖的package包/类
@Deprecated
public void cancelVolleyRequest(RequestFilter filter) {
if (mVolleyQueue!=null) {
mVolleyQueue.cancelAll(filter);
}
}
示例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);
}
}
示例12: cancelAllRequest
import com.android.volley.RequestQueue.RequestFilter; //导入依赖的package包/类
public static void cancelAllRequest(RequestFilter filter){
mQueue.cancelAll(filter);
}