fixed use of preferences
This commit is contained in:
parent
fda662f697
commit
af5579a30e
|
@ -77,7 +77,7 @@ public class DBCleanupTests extends InstrumentationTestCase {
|
|||
|
||||
SharedPreferences.Editor prefEdit = PreferenceManager.getDefaultSharedPreferences(context.getApplicationContext()).edit();
|
||||
prefEdit.putString(UserPreferences.PREF_EPISODE_CACHE_SIZE, Integer.toString(EPISODE_CACHE_SIZE));
|
||||
prefEdit.putInt(UserPreferences.PREF_EPISODE_CLEANUP, cleanupAlgorithm);
|
||||
prefEdit.putString(UserPreferences.PREF_EPISODE_CLEANUP, Integer.toString(cleanupAlgorithm));
|
||||
prefEdit.commit();
|
||||
|
||||
UserPreferences.init(context);
|
||||
|
|
|
@ -67,7 +67,7 @@ public class DBNullCleanupAlgorithmTest extends InstrumentationTestCase {
|
|||
|
||||
SharedPreferences.Editor prefEdit = PreferenceManager.getDefaultSharedPreferences(context.getApplicationContext()).edit();
|
||||
prefEdit.putString(UserPreferences.PREF_EPISODE_CACHE_SIZE, Integer.toString(EPISODE_CACHE_SIZE));
|
||||
prefEdit.putInt(UserPreferences.PREF_EPISODE_CLEANUP, UserPreferences.EPISODE_CLEANUP_NULL);
|
||||
prefEdit.putString(UserPreferences.PREF_EPISODE_CLEANUP, Integer.toString(UserPreferences.EPISODE_CLEANUP_NULL));
|
||||
prefEdit.commit();
|
||||
|
||||
UserPreferences.init(context);
|
||||
|
|
|
@ -496,7 +496,7 @@ public class UserPreferences {
|
|||
|
||||
|
||||
public static EpisodeCleanupAlgorithm getEpisodeCleanupAlgorithm() {
|
||||
int cleanupValue = prefs.getInt(PREF_EPISODE_CLEANUP, -1);
|
||||
int cleanupValue = Integer.valueOf(prefs.getString(PREF_EPISODE_CLEANUP, "-1"));
|
||||
if (cleanupValue == EPISODE_CLEANUP_QUEUE) {
|
||||
return new APQueueCleanupAlgorithm();
|
||||
} else if (cleanupValue == EPISODE_CLEANUP_NULL) {
|
||||
|
|
Loading…
Reference in New Issue