Try configuring an OkHttp3 client with authenticator, depending on your scheme and situation:
OkHttpClient client = new OkHttpClient.Builder()
.addInterceptor(new Interceptor() {
@Override
public Response intercept(Chain chain) throws IOException {
Request newRequest = chain.request().newBuilder()
.addHeader("Authorization", "bearer <accesstoeken>")
.build();
return chain.proceed(newRequest);
}
})
.build();
Picasso picasso = new Picasso.Builder(context)
.downloader(new OkHttp3Downloader(client))
.build();
Now use it as:
picasso.load(imgUrl).into(holder.mImgProfileView);
Posted On:
20-Mar-2020 07:28