Android(Java):如何在Volley 1.1.1中将OkHttpClient添加到RequestQueue

时间:2019-02-01 10:45:06

标签: java android android-volley okhttp

我从排球 1.0.0 升级到 1.1.1 ,并注意到newRequestQueue()不再使用OkHttpStack,但建议使用摘要BaseHttpStack,因此我不能将其虚假化。

在1.0.0版本中可用:

RequestQueue requestQueue = Volley.newRequestQueue(getApplicationContext(), 
                                new OkHttpStack(new OkHttpClient()));

在1.1.1中不起作用:

RequestQueue requestQueue = Volley.newRequestQueue(getApplicationContext(), 
                                new BaseHttpStack(new OkHttpClient()));

有什么想法吗?谢谢!

0 个答案:

没有答案