Inject member of AcitivityUi in onPreCreate

This commit is contained in:
serso 2016-02-26 22:30:10 +01:00
parent 9761b6e31c
commit 92f40a9b6d

View File

@ -135,7 +135,7 @@ public class ActivityUi {
} }
public void onPreCreate(@Nonnull Activity activity) { public void onPreCreate(@Nonnull Activity activity) {
final SharedPreferences preferences = App.getPreferences(); cast(activity.getApplication()).getComponent().inject(this);
theme = Preferences.Gui.getTheme(preferences); theme = Preferences.Gui.getTheme(preferences);
activity.setTheme(theme.getThemeFor(activity)); activity.setTheme(theme.getThemeFor(activity));
@ -145,8 +145,6 @@ public class ActivityUi {
} }
public void onCreate() { public void onCreate() {
cast(activity.getApplication()).getComponent().inject(this);
// let's disable locking of screen for monkeyrunner // let's disable locking of screen for monkeyrunner
if (App.isMonkeyRunner(activity)) { if (App.isMonkeyRunner(activity)) {
final KeyguardManager km = (KeyguardManager) activity.getSystemService(Context.KEYGUARD_SERVICE); final KeyguardManager km = (KeyguardManager) activity.getSystemService(Context.KEYGUARD_SERVICE);