• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

How do I let my app perform the next task after waiting for a few milliseconds?

Daniel Fernandes

Android Enthusiast
So, I'm making a flashlight app. I want to add a feature to change brightness of the camera flash. To do that I want it to rapidly turn the flash on and off. I want something like this:

while (this happens){
turn flash on;
wait for (some time);
turn flash off;
wait for (some different time);
}​

So, what function should I use for making my app wait. In Arduino, I used to use "delay(10);" where 10 means it has to wait for 10 milliseconds. I want something like this for Android.
 
Back
Top Bottom