AnnouncementPeriodicTask: acquire sharedprefences on start (so it can be restarted).

Introduced in 15fbd90ca4.
Fixes #665.
This commit is contained in:
Dennis Guse
2021-03-20 11:27:22 +01:00
parent 997ab6060e
commit 0a006d64f9
@@ -117,13 +117,14 @@ public class AnnouncementPeriodicTask implements PeriodicTask {
audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
contentProviderUtils = new ContentProviderUtils(context);
sharedPreferences = PreferencesUtils.getSharedPreferences(context);
}
@Override
public void start() {
Log.d(TAG, "Start");
sharedPreferences = PreferencesUtils.getSharedPreferences(context);
if (tts == null) {
tts = new TextToSpeech(context, status -> {
Log.i(TAG, "TextToSpeech initialized with status " + status);