android - How to avoid activity re-creation when being rotated, while also respecting orientation lock? -
background
each time device being rotated, android destroy current activity , re-create new configuration.
an easy way avoid activity re-creation adding "configchanges" values manifest ("screensize" , "orientation" recall).
the problem
if use "configchanges" attribute, app won't respect orientation lock feature (or all?) android devices have, prevent being rotated when screen being rotated.
what i've tried
i tried playing "screenorientation" attribute values, yet none of them achieved wanted.
the question
how can prevent activity being re-created when screen changes orientation, while respecting user preference of orientation-lock?
is perhaps possible value of preference, let activity lock orientation when it's being set?
ok, never mind. think missed correct one:
android:screenorientation="user"
together other configchanges values, works perfectly.
Comments
Post a Comment