Added theme change check at the end of MainActivity onCreate

This commit is contained in:
Juha Heinanen
2021-01-15 11:34:37 +02:00
parent 182e160351
commit c9cd6cd2e3

View File

@ -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) {