Fix NPE in FloatingCalculatorService

This commit is contained in:
serso 2017-07-26 10:32:00 +02:00
parent 14ff42daf7
commit f4cb71ab53

View File

@ -159,7 +159,6 @@ public class CalculatorApplication extends android.app.Application implements Sh
} }
private void onPostCreate(@Nonnull final SharedPreferences prefs, @Nonnull Languages languages) { private void onPostCreate(@Nonnull final SharedPreferences prefs, @Nonnull Languages languages) {
App.init(this, prefs);
languages.init(); languages.init();
prefs.registerOnSharedPreferenceChangeListener(this); prefs.registerOnSharedPreferenceChangeListener(this);
@ -198,6 +197,9 @@ public class CalculatorApplication extends android.app.Application implements Sh
.setFormUriBasicAuthLogin("timbeenterumisideffecird") .setFormUriBasicAuthLogin("timbeenterumisideffecird")
.setFormUriBasicAuthPassword("ECL65PO2TH5quIFNAK4hQ5Ng")); .setFormUriBasicAuthPassword("ECL65PO2TH5quIFNAK4hQ5Ng"));
} }
// initializing App before #onCreate as FloatingCalculatorService might be created in
// #onCreate
App.init(this, prefs);
// then we should set default preferences // then we should set default preferences
Preferences.init(this, prefs); Preferences.init(this, prefs);