com.android.volley.Request.shouldCache()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(3.9k)|赞(0)|评价(0)|浏览(180)

本文整理了Java中com.android.volley.Request.shouldCache方法的一些代码示例,展示了Request.shouldCache的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.shouldCache方法的具体详情如下:
包路径:com.android.volley.Request
类名称:Request
方法名:shouldCache

Request.shouldCache介绍

[英]Returns true if responses to this request should be cached.
[中]如果应该缓存对此请求的响应,则返回true。

代码示例

代码示例来源:origin: chentao0707/SimplifyReader

  1. if (request.shouldCache()) {
  2. synchronized (mWaitingRequests) {
  3. String cacheKey = request.getCacheKey();

代码示例来源:origin: mcxiaoke/android-volley

  1. if (request.shouldCache()) {
  2. synchronized (mWaitingRequests) {
  3. String cacheKey = request.getCacheKey();

代码示例来源:origin: jiangqqlmj/FastDev4Android

  1. if (request.shouldCache()) {
  2. synchronized (mWaitingRequests) {
  3. String cacheKey = request.getCacheKey();

代码示例来源:origin: chentao0707/SimplifyReader

  1. if (!request.shouldCache()) {
  2. mNetworkQueue.add(request);
  3. return request;

代码示例来源:origin: mcxiaoke/android-volley

  1. if (!request.shouldCache()) {
  2. mNetworkQueue.add(request);
  3. return request;

代码示例来源:origin: jiangqqlmj/FastDev4Android

  1. if (!request.shouldCache()) {
  2. mNetworkQueue.add(request);
  3. return request;

代码示例来源:origin: chentao0707/SimplifyReader

  1. if (request.shouldCache() && response.cacheEntry != null) {
  2. mCache.put(request.getCacheKey(), response.cacheEntry);
  3. request.addMarker("network-cache-written");

代码示例来源:origin: mcxiaoke/android-volley

  1. if (request.shouldCache() && response.cacheEntry != null) {
  2. mCache.put(request.getCacheKey(), response.cacheEntry);
  3. request.addMarker("network-cache-written");

代码示例来源:origin: jiangqqlmj/FastDev4Android

  1. if (request.shouldCache() && response.cacheEntry != null) {
  2. mCache.put(request.getCacheKey(), response.cacheEntry);
  3. request.addMarker("network-cache-written");

代码示例来源:origin: xuningjack/AndroidNet

  1. /**
  2. * Called from {@link Request#finish(String)}, indicating that processing of the given request
  3. * has finished.
  4. *
  5. * <p>Releases waiting requests for <code>request.getCacheKey()</code> if
  6. * <code>request.shouldCache()</code>.</p>
  7. */
  8. void finish(Request<?> request) {
  9. // Remove from the set of requests currently being processed.
  10. synchronized (mCurrentRequests) {
  11. mCurrentRequests.remove(request);
  12. }
  13. if (request.shouldCache()) {
  14. synchronized (mWaitingRequests) {
  15. String cacheKey = request.getCacheKey();
  16. Queue<Request<?>> waitingRequests = mWaitingRequests.remove(cacheKey);
  17. if (waitingRequests != null) {
  18. if (VolleyLog.DEBUG) {
  19. VolleyLog.v("Releasing %d waiting requests for cacheKey=%s.",
  20. waitingRequests.size(), cacheKey);
  21. }
  22. // Process all queued up requests. They won't be considered as in flight, but
  23. // that's not a problem as the cache has been primed by 'request'.
  24. mCacheQueue.addAll(waitingRequests);
  25. }
  26. }
  27. }
  28. }
  29. }

代码示例来源:origin: MewX/light-novel-library_Wenku8_Android

  1. if (request.shouldCache()) {
  2. synchronized (mWaitingRequests) {
  3. String cacheKey = request.getCacheKey();

代码示例来源:origin: jungletian/TitanjumNote

  1. if (request.shouldCache()) {
  2. synchronized (mWaitingRequests) {
  3. String cacheKey = request.getCacheKey();

代码示例来源:origin: com.mcxiaoke.volley/library

  1. if (request.shouldCache()) {
  2. synchronized (mWaitingRequests) {
  3. String cacheKey = request.getCacheKey();

代码示例来源:origin: AnandChowdhary/saga-android

  1. if (request.shouldCache()) {
  2. synchronized (mWaitingRequests) {
  3. String cacheKey = request.getCacheKey();

代码示例来源:origin: chuyangliu/tastysnake

  1. if (request.shouldCache()) {
  2. synchronized (mWaitingRequests) {
  3. String cacheKey = request.getCacheKey();

代码示例来源:origin: tazimete/android-app-food-delivery-system

  1. if (request.shouldCache()) {
  2. synchronized (mWaitingRequests) {
  3. String cacheKey = request.getCacheKey();

代码示例来源:origin: panxw/android-volley-manager

  1. if (request.shouldCache()) {
  2. synchronized (mWaitingRequests) {
  3. String cacheKey = request.getCacheKey();

代码示例来源:origin: tazimete/android-app-food-delivery-system

  1. if (request.shouldCache()) {
  2. synchronized (mWaitingRequests) {
  3. String cacheKey = request.getCacheKey();

代码示例来源:origin: cat9/EasyVolley

  1. if (request.shouldCache()) {
  2. synchronized (mWaitingRequests) {
  3. String cacheKey = request.getCacheKey();

代码示例来源:origin: com.mcxiaoke.volley/library

  1. if (!request.shouldCache()) {
  2. mNetworkQueue.add(request);
  3. return request;

相关文章