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
|
|
@ -51,7 +51,7 @@
|
|||
android:name=".MainActivity"
|
||||
android:exported="true"
|
||||
android:launchMode="singleTask"
|
||||
android:configChanges="keyboard|keyboardHidden|navigation|orientation|screenSize|screenLayout|smallestScreenSize">
|
||||
android:configChanges="keyboard|keyboardHidden|navigation|orientation|screenSize|screenLayout|smallestScreenSize|density">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue