Added theme change check at the end of MainActivity onCreate
This commit is contained in:
@ -69,6 +69,7 @@ class MainActivity : AppCompatActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
binding = ActivityMainBinding.inflate(layoutInflater)
|
||||
|
||||
val intentAction = intent.getStringExtra("action")
|
||||
@ -479,6 +480,11 @@ class MainActivity : AppCompatActivity() {
|
||||
|
||||
intent.removeExtra("action")
|
||||
|
||||
if (Preferences(applicationContext).displayTheme != AppCompatDelegate.getDefaultNightMode()) {
|
||||
AppCompatDelegate.setDefaultNightMode(Preferences(applicationContext).displayTheme)
|
||||
delegate.applyDayNight()
|
||||
}
|
||||
|
||||
} // OnCreate
|
||||
|
||||
override fun onNewIntent(intent: Intent) {
|
||||
|
||||
Reference in New Issue
Block a user