1

Добавил зависимость implementation 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0', в MyApplication:

    Picasso.Builder builder = new Picasso.Builder(this);
    builder.downloader(new OkHttp3Downloader(this, Integer.MAX_VALUE));
    Picasso built = builder.build();
    built.setIndicatorsEnabled(true);
    built.setLoggingEnabled(true);
    Picasso.setSingletonInstance(built);

И добавил: .networkPolicy(NetworkPolicy.OFFLINE) Но теперь вообще ничего не загружается. В чем может быть причина?

1 ответ 1

2

Используй это:

compile 'com.squareup.picasso:picasso:2.5.2'

В Picasso кэширование включено по умолчанию. и а также другие параметры, которые используются в memoryPolicy(,)

Picasso 
    .with(context) 
    .load(UsageExampleListViewAdapter.eatFoodyImages[1]) 
    .memoryPolicy(MemoryPolicy.NO_CACHE, MemoryPolicy.NO_STORE) 
.into(imageViewFromDisk); 

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge you have read our privacy policy.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.