Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ExoPlayerCache {
- private static SimpleCache cache;
- public static SimpleCache getInstance(Context ctx){
- DatabaseProvider dp =
- new DefaultDatabaseProvider(
- new SQLiteOpenHelper(
- ctx,
- "ExoPlayer",
- null,
- 1) {
- @Override
- public void onCreate(SQLiteDatabase db) { }
- @Override
- public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { }
- });
- if (cache == null) {
- cache = new SimpleCache(
- new File(ctx.getCacheDir(),
- "ExoPlayerCache"),
- new LeastRecentlyUsedCacheEvictor(50 * 1024 * 1024),
- dp);
- /* cache = new SimpleCache(
- new File(ctx.getCacheDir(),
- "ExoPlayerCache"),
- new LeastRecentlyUsedCacheEvictor(50 * 1024 * 1024));*/
- }
- return cache;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement