From 92f40a9b6d9ce408b7c5d4dc9025a27855db020c Mon Sep 17 00:00:00 2001 From: serso Date: Fri, 26 Feb 2016 22:30:10 +0100 Subject: [PATCH] Inject member of AcitivityUi in onPreCreate --- .../main/java/org/solovyev/android/calculator/ActivityUi.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/src/main/java/org/solovyev/android/calculator/ActivityUi.java b/app/src/main/java/org/solovyev/android/calculator/ActivityUi.java index 822a82bb..46891ca6 100644 --- a/app/src/main/java/org/solovyev/android/calculator/ActivityUi.java +++ b/app/src/main/java/org/solovyev/android/calculator/ActivityUi.java @@ -135,7 +135,7 @@ public class ActivityUi { } public void onPreCreate(@Nonnull Activity activity) { - final SharedPreferences preferences = App.getPreferences(); + cast(activity.getApplication()).getComponent().inject(this); theme = Preferences.Gui.getTheme(preferences); activity.setTheme(theme.getThemeFor(activity)); @@ -145,8 +145,6 @@ public class ActivityUi { } public void onCreate() { - cast(activity.getApplication()).getComponent().inject(this); - // let's disable locking of screen for monkeyrunner if (App.isMonkeyRunner(activity)) { final KeyguardManager km = (KeyguardManager) activity.getSystemService(Context.KEYGUARD_SERVICE);