Handle density configuration changes to prevent unnecessary app restarts (#1828)
## Description Add `density` to `configChanges` and handle any changes to density that occur. Thankfully, Compose handles density changes itself, so only changes where a density calculation is "remembered" needed to be updated. Without this, some devices will recreate `MainActivity` when switching resolutions for playback. That recreation would cause playback to end immediately. ### Related issues Fixes #1809 ### Testing Tested on Onn 4k Pro & nvidia shield I was able to reproduce on the Onn, but not the Shield, so this might be device and/or API level specific ## Screenshots N/A ## AI or LLM usage None
This commit is contained in:
parent
e6304f79a2
commit
54966f9124
12 changed files with 31 additions and 12 deletions
|
|
@ -380,7 +380,7 @@ class MainActivity : AppCompatActivity() {
|
|||
|
||||
override fun onConfigurationChanged(newConfig: Configuration) {
|
||||
super.onConfigurationChanged(newConfig)
|
||||
Timber.d("onConfigurationChanged")
|
||||
Timber.d("onConfigurationChanged: newConfig=%s", newConfig)
|
||||
}
|
||||
|
||||
override fun onNewIntent(intent: Intent) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue