I'm using the following flags in onAttachedToWindow()
to show my Activity
above the keyguard:
FLAG_DISMISS_KEYGUARD | FLAG_SHOW_WHEN_LOCKED | FLAG_TURN_SCREEN_ON
This works fine, however, when launching my activity from a background service while the screen was off, the keyguard sometimes shows for 1-2 seconds before my app is displayed. This happens particularly on slower phones (or in low memory situations). I find this strange, since my understanding was that onAttachedToWindow()
is called after onCreate()
/onResume()
, so all the "heavy work" should already have been completed when the flags mentioned above are being set? Is there any way to only show my Activity
once it has been completely set up?
Have you tried UI Thread. Try to look at this good tutorial http://androidpartaker.wordpress.com/tag/ui-thread/. Hopre this helps you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With