use explicit Response class from okhttp fixing #3071

This commit is contained in:
Peter 2016-06-08 22:37:41 +02:00
parent 3165e1c39d
commit 6df4ffab13

View File

@ -13,7 +13,6 @@ import com.google.gson.reflect.TypeToken;
import com.squareup.okhttp.Call;
import com.squareup.okhttp.Interceptor;
import com.squareup.okhttp.Response;
import java.io.IOException;
@ -90,8 +89,8 @@ public class {{classname}} {
if(progressListener != null) {
apiClient.getHttpClient().networkInterceptors().add(new Interceptor() {
@Override
public Response intercept(Interceptor.Chain chain) throws IOException {
Response originalResponse = chain.proceed(chain.request());
public com.squareup.okhttp.Response intercept(Interceptor.Chain chain) throws IOException {
com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request());
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), progressListener))
.build();