sleeping

Waiting for invokeLater() to be called

Is there a more elegant way to do what I'm doing below? That is, is there a more elegant way than polling and sleeping, polling and sleeping, and so on to know when a Runnable.run() method has been called via invokeLater()? private int myMethod() { final WaitForEventQueue waitForQueue = new WaitForEventQueue(); EventQueue.invok...

How to prevent sleeping in Android

Hello I 'm working with GPS in my application. When phone go to sleep, the GPS's data don't update. I want to stay phone screen wake up until my app will be close. How can I prevent sleeping in Android? ...