I figured out a way!

          Object obj = new Object();

          synchronized (obj) {
            try {
              obj.wait(FETCH_DELAY_MILLIS);
            }
            catch (InterruptedException e) {
              // Ignore
            }
          }

This one sleeps just perfectly! (damn, what a hack :)

NTR wrote:
> As said here:
>
> http://groups.google.com/group/android-developers/browse_thread/thread/8f736492d4ba8e04/51444bb1059a91eb?#51444bb1059a91eb
>
> I noticed the same - Thread.sleep, and also TimerTasks, take 100% of
> my PC's CPU, and also bring the emulator to its knees. I'd like to run
> a service in the background that does things every now and then, do
> you know any workarounds for this issue? :/ It really kills my
> application...
>
> I'm running something only every 2 minutes (confirmed from the logs),
> but still, the emulator basically hangs whenever Thread.sleep is
> called (of course I'm not doing that in the main thread, but just as I
> tried to emulate TimerTasks, since they hanged as well)...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to