Databases is now loaded even if no storage is available
This commit is contained in:
parent
d061f86266
commit
8fb81fa799
|
@ -24,3 +24,4 @@ local.properties
|
|||
# other
|
||||
*.odg#
|
||||
Docs/todo
|
||||
Docs/market
|
||||
|
|
|
@ -44,11 +44,9 @@ public class PodcastApp extends Application implements
|
|||
SharedPreferences prefs = PreferenceManager
|
||||
.getDefaultSharedPreferences(this);
|
||||
prefs.registerOnSharedPreferenceChangeListener(this);
|
||||
if (StorageUtils.storageAvailable()) {
|
||||
FeedManager manager = FeedManager.getInstance();
|
||||
manager.loadDBData(getApplicationContext());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLowMemory() {
|
||||
|
@ -60,7 +58,8 @@ public class PodcastApp extends Application implements
|
|||
@Override
|
||||
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,
|
||||
String key) {
|
||||
if (AppConfig.DEBUG) Log.d(TAG, "Registered change of application preferences");
|
||||
if (AppConfig.DEBUG)
|
||||
Log.d(TAG, "Registered change of application preferences");
|
||||
if (key.equals(PREF_UPDATE_INTERVALL)) {
|
||||
AlarmManager alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
|
||||
int hours = Integer.parseInt(sharedPreferences.getString(
|
||||
|
@ -72,9 +71,11 @@ public class PodcastApp extends Application implements
|
|||
long newIntervall = TimeUnit.HOURS.toMillis(hours);
|
||||
alarmManager.setRepeating(AlarmManager.RTC_WAKEUP,
|
||||
newIntervall, newIntervall, updateIntent);
|
||||
if (AppConfig.DEBUG) Log.d(TAG, "Changed alarm to new intervall");
|
||||
if (AppConfig.DEBUG)
|
||||
Log.d(TAG, "Changed alarm to new intervall");
|
||||
} else {
|
||||
if (AppConfig.DEBUG) Log.d(TAG, "Automatic update was deactivated");
|
||||
if (AppConfig.DEBUG)
|
||||
Log.d(TAG, "Automatic update was deactivated");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue