clear disk cache on startup

This commit is contained in:
Andrew Dolgov 2015-03-11 09:25:55 +03:00
parent 1bf843a451
commit 9690deb11c
2 changed files with 11 additions and 12 deletions

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.fox.ttrss" package="org.fox.ttrss"
android:versionCode="319" android:versionCode="320"
android:versionName="1.94" > android:versionName="1.95" >
<uses-sdk <uses-sdk
android:minSdkVersion="15" android:minSdkVersion="15"

View File

@ -32,7 +32,7 @@ import com.google.gson.Gson;
import com.google.gson.JsonElement; import com.google.gson.JsonElement;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import com.google.gson.reflect.TypeToken; import com.google.gson.reflect.TypeToken;
import com.nostra13.universalimageloader.cache.disc.impl.LimitedAgeDiscCache; import com.nostra13.universalimageloader.cache.disc.impl.UnlimitedDiscCache;
import com.nostra13.universalimageloader.core.ImageLoader; import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration; import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
import com.nostra13.universalimageloader.utils.StorageUtils; import com.nostra13.universalimageloader.utils.StorageUtils;
@ -164,15 +164,14 @@ public class OnlineActivity extends CommonActivity {
setContentView(R.layout.login); setContentView(R.layout.login);
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(getApplicationContext()) if (!ImageLoader.getInstance().isInited()) {
.diskCache( ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(getApplicationContext())
new LimitedAgeDiscCache(new File(StorageUtils.getCacheDirectory(getApplicationContext()), "article-images"), .diskCache(
2*24*60*60)) // 2 days new UnlimitedDiscCache(new File(StorageUtils.getCacheDirectory(getApplicationContext()), "article-images")))
.build(); .build();
ImageLoader.getInstance().init(config); ImageLoader.getInstance().init(config);
//ImageLoader.getInstance().clearDiskCache(); ImageLoader.getInstance().clearDiskCache();
}
//m_pullToRefreshAttacher = PullToRefreshAttacher.get(this); //m_pullToRefreshAttacher = PullToRefreshAttacher.get(this);