This is by design. Time stops for sleeping threads when the handset is not awake.
However, the AlarmManager never sleeps -- well, in most implementations: http://community.developer.motorola.com/t5/Android-App-Development-for/AlarmManager-ELAPSED-REALTIME-WAKEUP-amp-RTC-WAKEUP-won-t-wake/td-p/4987 On May 6, 4:27 am, Raj <[email protected]> wrote: > Hi All, > I have a created a thread in my application, and have a sleep for 5sec > in the run() function. This sleep function returns properly after 5 > secs only if the device screen is turned ON. In case the device screen > goes to Hibernate, sleep function returns after around 2-3 > minutes(instead of 5 sec). > > Have any one faced this issue earlier? > > Regards, > Raj > > -- > 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 > athttp://groups.google.com/group/android-developers?hl=en -- 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

