No, don't take out screenOrientation if you need it, it is not deprecated, and having it in the manifest is better than forcing it dynamically from code.

As for the activity being recreated, that's not considered a bug, but a side effect of the top (your) activity's orientation being different from the lock screen's.

-- Kostya

03.10.2011 21:26, Latimerius ?????:


On Mon, Oct 3, 2011 at 7:04 PM, Kostya Vasilyev <[email protected] <mailto:[email protected]>> wrote:

    Make sure you didn't accidentally leave an orientation lock in the
    manifest, android:screenOrientation="landscape".


Well I have this in my manifest quite intentionally ;-) - it's a game, it depends on landscape and doesn't make any sense in portrait. I take it screenOrientation is somehow wrong now? I'll re-read the docs ...

    You would also see this sequence if your activity runs in
    landscape mode just because of how you're holding the device, and
    the device's lock screen uses portrait mode (or vice versa, I
    would assume).

    Try the test again, but hold the device in portrait mode, you
    should only see onPause / onResume when you lock and unlock.


Cool, you're right - my SkeletonActivity-based test (which is not locked to any orientation) does exactly what you say (onResume() is still called *before* unlocking, when the activity is not visible but that's a minor concern for me now).

I wonder though if it's a bug - I mean, going through onCreate(), onResume() and onPause() seems quite a lot of wasted effort for an activity that's hidden behind a blank screen ...
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

--
Kostya Vasilyev

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to