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?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
|
||||||
binding = ActivityMainBinding.inflate(layoutInflater)
|
binding = ActivityMainBinding.inflate(layoutInflater)
|
||||||
|
|
||||||
val intentAction = intent.getStringExtra("action")
|
val intentAction = intent.getStringExtra("action")
|
||||||
@@ -479,6 +480,11 @@ class MainActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
intent.removeExtra("action")
|
intent.removeExtra("action")
|
||||||
|
|
||||||
|
if (Preferences(applicationContext).displayTheme != AppCompatDelegate.getDefaultNightMode()) {
|
||||||
|
AppCompatDelegate.setDefaultNightMode(Preferences(applicationContext).displayTheme)
|
||||||
|
delegate.applyDayNight()
|
||||||
|
}
|
||||||
|
|
||||||
} // OnCreate
|
} // OnCreate
|
||||||
|
|
||||||
override fun onNewIntent(intent: Intent) {
|
override fun onNewIntent(intent: Intent) {
|
||||||
|
|||||||
Reference in New Issue
Block a user