mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-05-04 20:30:36 +00:00
Set the Activity theme before calling super.onCreate (#84)
This fixes a NullPointerException that would occur when restoring from savedInstanceState due to getSupportActionBar returning null. It also removes the theme definitions from AndroidManifest as we override those anyway.
This commit is contained in:
parent
0fb33744ae
commit
9958f73926
2 changed files with 9 additions and 15 deletions
|
@ -20,9 +20,12 @@ public abstract class AegisActivity extends AppCompatActivity {
|
|||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
_app = (AegisApplication) getApplication();
|
||||
|
||||
// set the theme and create the activity
|
||||
setPreferredTheme(Theme.fromInteger(getPreferences().getCurrentTheme()));
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
// if the app was killed, relaunch MainActivity and close everything else
|
||||
if (!(this instanceof MainActivity) && !(this instanceof AuthActivity) && _app.getDatabaseManager().isLocked()) {
|
||||
Intent intent = new Intent(this, MainActivity.class);
|
||||
|
@ -37,9 +40,6 @@ public abstract class AegisActivity extends AppCompatActivity {
|
|||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
|
||||
}
|
||||
|
||||
// set the theme
|
||||
setPreferredTheme(getPreferences().getCurrentTheme());
|
||||
|
||||
// apply a dirty hack to make progress bars work even if animations are disabled
|
||||
setGlobalAnimationDurationScale();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue