forked from upstream-mirrors/OpenTracks
AnnouncementPeriodicTask: acquire sharedprefences on start (so it can be restarted).
Introduced in 15fbd90ca4.
Fixes #665.
This commit is contained in:
@@ -117,13 +117,14 @@ public class AnnouncementPeriodicTask implements PeriodicTask {
|
|||||||
audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
|
audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
|
||||||
contentProviderUtils = new ContentProviderUtils(context);
|
contentProviderUtils = new ContentProviderUtils(context);
|
||||||
|
|
||||||
sharedPreferences = PreferencesUtils.getSharedPreferences(context);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void start() {
|
public void start() {
|
||||||
Log.d(TAG, "Start");
|
Log.d(TAG, "Start");
|
||||||
|
|
||||||
|
sharedPreferences = PreferencesUtils.getSharedPreferences(context);
|
||||||
|
|
||||||
if (tts == null) {
|
if (tts == null) {
|
||||||
tts = new TextToSpeech(context, status -> {
|
tts = new TextToSpeech(context, status -> {
|
||||||
Log.i(TAG, "TextToSpeech initialized with status " + status);
|
Log.i(TAG, "TextToSpeech initialized with status " + status);
|
||||||
|
|||||||
Reference in New Issue
Block a user