Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Commit 9350b40

Browse files
MortimerGorobluemarvin
authored andcommitted
Move accounts initialization to Activity onCreate (#2926)
* Move accounts initialization to onActivityCreate
1 parent b68f946 commit 9350b40

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

app/src/common/shared/org/mozilla/vrbrowser/VRBrowserActivity.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ protected void attachBaseContext(Context base) {
216216

217217
@Override
218218
protected void onCreate(Bundle savedInstanceState) {
219+
((VRBrowserApplication)getApplication()).onActivityCreate();
219220
SettingsStore.getInstance(getBaseContext()).setPid(Process.myPid());
220221
// Fix for infinite restart on startup crashes.
221222
long count = SettingsStore.getInstance(getBaseContext()).getCrashRestartCount();

app/src/common/shared/org/mozilla/vrbrowser/VRBrowserApplication.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,20 @@ public class VRBrowserApplication extends Application {
3131
@Override
3232
public void onCreate() {
3333
super.onCreate();
34-
3534
mAppExecutors = new AppExecutors();
36-
mPlaces = new Places(this);
3735
mBitmapCache = new BitmapCache(this, mAppExecutors.diskIO(), mAppExecutors.mainThread());
38-
mServices = new Services(this, mPlaces);
39-
mAccounts = new Accounts(this);
36+
4037

4138
TelemetryWrapper.init(this);
4239
GleanMetricsService.init(this);
4340
}
4441

42+
protected void onActivityCreate() {
43+
mPlaces = new Places(this);
44+
mServices = new Services(this, mPlaces);
45+
mAccounts = new Accounts(this);
46+
}
47+
4548
@Override
4649
protected void attachBaseContext(Context base) {
4750
Context context = LocaleUtils.init(base);

0 commit comments

Comments
 (0)