use of com.google.android.exoplayer2.database.ExoDatabaseProvider in project Slide by ccrama.
the class Reddit method onCreate.
@Override
public void onCreate() {
super.onCreate();
mApplication = this;
// LeakCanary.install(this);
if (ProcessPhoenix.isPhoenixProcess(this)) {
return;
}
final File dir;
if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED) && getExternalCacheDir() != null) {
dir = new File(getExternalCacheDir() + File.separator + "video-cache");
} else {
dir = new File(getCacheDir() + File.separator + "video-cache");
}
LeastRecentlyUsedCacheEvictor evictor = new LeastRecentlyUsedCacheEvictor(256 * 1024 * 1024);
DatabaseProvider databaseProvider = new ExoDatabaseProvider(getAppContext());
// 256MB
videoCache = new SimpleCache(dir, evictor, databaseProvider);
UpgradeUtil.upgrade(getApplicationContext());
doMainStuff();
}
Aggregations