Skip to content

Activity recreation restricted by default #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
radusalagean opened this issue May 4, 2025 · 0 comments
Open

Activity recreation restricted by default #43

radusalagean opened this issue May 4, 2025 · 0 comments

Comments

@radusalagean
Copy link

Greetings!

Just like a previous issue mentions, I was wondering if there is a specific reason why this is present by default in the template:

android:configChanges="orientation|screenSize|screenLayout|keyboardHidden|mnc|colorMode|density|fontScale|fontWeightAdjustment|keyboard|layoutDirection|locale|mcc|navigation|smallestScreenSize|touchscreen|uiMode"

The official docs mention that:

You can prevent automatic activity recreation for certain configuration changes. Activity recreation results in recreating the entire UI, and any objects derived from the Activity. You might have good reasons to avoid this. For example, your app might not need to update resources during a specific configuration change, or you might have a performance limitation. In that case, you can declare that your activity handles the configuration change itself and prevent the system from restarting your activity.

From my understanding, this is an option that should be used only when needed. Considering this is a starter template, if there is no reason to override the default behavior, I'd suggest removing that line entirely. What are your thoughts on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant