This might be the wrong place to ask, but what is ...
# compose-android
v
This might be the wrong place to ask, but what is the status of
android:configChanges="allKnown"
? I'm not able to find any references to this value outside of Android's source code, but it seems like an obvious replacement to specifying all known values (``density|fontScale|keyboard|...``). One additional benefit of the
"allKnown"
value is that wallpaper changes no longer cause activity recreation.
k
There was a great talk about that topic during the DroidCon NY made by Alex Vanyo: https://www.droidcon.com/2025/07/23/handling-configuration-changes-in-compose/ I took a screenshot of one of the slides from this presentation, as it wasn’t immediately obvious to me. I think the recommendation is to declare it this way. If I understood it correctly, the
resourcesUnused
should be the one that will allow you to opt out of any new configuration in the future
s
One additional benefit of the
"allKnown"
value is that wallpaper changes no longer cause activity recreation.
Where did you get this information from?
k
In the linked presentation, Alex said that. The configuration responsible for handling this is
assetsPath
v
I tested it on A13. AAPT2 expands it to all configuration changes, even for those who are supposed to be hidden. That might be a bug. <https://cs.android.com/android/_/android/platform/frameworks/base/+/b9b08c491070fc21[…]00ad:tools/aapt2/link/ManifestFixer.cpp;l=175-226;bpv=0;bpt=0>
There was a great talk about that topic during the DroidCon NY made by Alex Vanyo:
https://www.droidcon.com/2025/07/23/handling-configuration-changes-in-compose/
Thanks, I had seen that before but must have missed/forgotten about
allKnown
s
Ah only for Android 16, I see
a
Right,
allKnown
is a “meta” value for
android:configChanges
that gets expanded out to all of the ones that are currently known at that point in time.
One additional benefit of the
"allKnown"
value is that wallpaper changes no longer cause activity recreation.
That’s specifically the
assetsPaths
option (which
allKnown
will expand out to include), which is newly declarable with Android 16. A fun detail of how it works is that the same bitmask value was used back since Android 12 when the wallpaper changes first caused activity recreation. So if you add
assetsPaths
to
android:configChanges
, you should see wallpaper changes no longer causing activity recreation even before Android 16.
💡 1
s
the same bitmask value was used back since Android 12 when the wallpaper changes first caused activity recreation.
Does this mean that one would've been able to skip those recreations back in 12 as well by flipping those bits, but there was just no way for normal consumers to flip said bits? Because afaik there was no way to do that earlier
a
Yeah, that's my understanding of how it would work if you could
Oops I did not mean to send that to the channel
c
very cool! TIL and will have to watch that talk. Thanks Alex!