Fix WorkManager initialization #438
|
@ -184,6 +184,9 @@ public class SWADMain extends MenuExpandableListActivity {
|
||||||
initializeMainViews();
|
initializeMainViews();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
// Initialize WorkManager
|
||||||
|
workManager = WorkManager.getInstance(this);
|
||||||
|
|
||||||
// Create Notifications channel
|
// Create Notifications channel
|
||||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
|
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
|
||||||
AlertNotificationFactory.createNotificationChanel(this);
|
AlertNotificationFactory.createNotificationChanel(this);
|
||||||
|
@ -212,8 +215,6 @@ public class SWADMain extends MenuExpandableListActivity {
|
||||||
|
|
||||||
View view = findViewById(R.id.main_view);
|
View view = findViewById(R.id.main_view);
|
||||||
setOnApplyWindowInsetsListener(view);
|
setOnApplyWindowInsetsListener(view);
|
||||||
|
|
||||||
workManager = WorkManager.getInstance(this);
|
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
error(ex.getMessage(), ex);
|
error(ex.getMessage(), ex);
|
||||||
}
|
}
|
||||||
|
|
|
@ -271,6 +271,9 @@ public class Notifications extends Module implements
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
workManager = WorkManager.getInstance(this);
|
||||||
|
|
||||||
setContentView(R.layout.expandablelist_items_pulltorefresh);
|
setContentView(R.layout.expandablelist_items_pulltorefresh);
|
||||||
|
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
@ -318,8 +321,6 @@ public class Notifications extends Module implements
|
||||||
|
|
||||||
View view = findViewById(R.id.expandablelist_items_pulltorefresh);
|
View view = findViewById(R.id.expandablelist_items_pulltorefresh);
|
||||||
setOnApplyWindowInsetsListener(view);
|
setOnApplyWindowInsetsListener(view);
|
||||||
|
|
||||||
workManager = WorkManager.getInstance(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -149,6 +149,8 @@ public class PreferencesActivity extends PreferenceActivity implements OnPrefere
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
workManager = WorkManager.getInstance(ctx);
|
||||||
|
|
||||||
//Restore preferences
|
//Restore preferences
|
||||||
getPreferenceManager().setSharedPreferencesName(Preferences.PREFS_NAME);
|
getPreferenceManager().setSharedPreferencesName(Preferences.PREFS_NAME);
|
||||||
|
@ -238,8 +240,6 @@ public class PreferencesActivity extends PreferenceActivity implements OnPrefere
|
||||||
} catch (PackageManager.NameNotFoundException ex) {
|
} catch (PackageManager.NameNotFoundException ex) {
|
||||||
error(ex.getMessage(), ex);
|
error(ex.getMessage(), ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
workManager = WorkManager.getInstance(ctx);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user