<Can I trust my global variables to always be pres...
# stackoverflow
r
Can I trust my global variables to always be preserved during screen rotation? (Android / Kotlin) Is it bad practice to use Global variables instead of bundles to preserve state between screen rotations? I really like just using global variables to keep state. But since everything suggests using bundles, should I do that? I don't know what pitfalls I could be thinking of. Here is a snippet of code that demonstrates global variables dont change. I have to check that the LEVEL_DEFS list is 0 before adding to it, otherwise every screen rotation adds duplicate levels (where I originally...