miao1007 / AnimeWallpaper

[Android] Konachan wallpaper downloader
http://www.jianshu.com/p/93475df308b8
430 stars 84 forks source link

Can't not load picture, search not working on Android 6, Xiaomi mi 4 #14

Closed hungvu193 closed 1 year ago

miao1007 commented 6 years ago

in SquareUtils. getHTTPDnsClient, uncomment the debug settings

hungvu193 commented 6 years ago
 /**
   * OkHttp client for httpDNS, shared Executor
   */
  static public synchronized OkHttpClient getHTTPDnsClient() {
    if (httpDnsclient == null) {
       final File cacheDir = GlobalContext.getInstance().getExternalCacheDir();
        httpDnsclient = new OkHttpClient.Builder().dispatcher(getDispatcher())
          .addInterceptor(getLogger())
          .addNetworkInterceptor(new Interceptor() {
            //REWRITE_CACHE_CONTROL_INTERCEPTOR
            @Override public Response intercept(Chain chain) throws IOException {
              Response originalResponse = chain.proceed(chain.request());
              return originalResponse.newBuilder()
                  //dns default cache time
                  .header("Cache-Control", "max-age=600").build();
            }
          }).cache(new Cache(new File(cacheDir, "httpdns"), 5 * 1024 * 1024)).build();
    }
    return httpDnsclient;
  }

You mean this function, i have uncommented .addInterceptor(getLogger()) options but it doesnt work for me.``

Dahcode commented 5 years ago

does not show image