added option: move cache to external storage

This commit is contained in:
Philipp Schaefer
2013-10-22 12:12:17 +02:00
parent 9248fe6221
commit 437a33f1d5
6 changed files with 36 additions and 5 deletions

View File

@ -0,0 +1,17 @@
package com.cradle.iitc_mobile;
import android.app.Application;
import android.preference.PreferenceManager;
import java.io.File;
public class IITC_Application extends Application {
@Override
public File getCacheDir() {
if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean("pref_external_storage", false)) {
return (getExternalCacheDir() != null) ? getExternalCacheDir() : super.getCacheDir();
} else {
return super.getCacheDir();
}
}
}