Sunday, 15 September 2013

Android Timer/Clock

Android Timer/Clock

i want a clock/timer that's not insanely fast and force closes like a
while loop. This force closes:
while(loopEnabled == true)
{
//Do stuff
Toast toast Toast.makeText(this, "Hi!", 10000);
toast.show();
}
And so does this:
public void loop()
{
//Do stuff
Toast toast Toast.makeText(this, "Hi!", 10000);
toast.show();
resetLoop();
}
public void resetLoop()
{
Thread.sleep(100);
loop();
}
Any alternatives to stop this? I'm meaning for code to happen rapidly over
and over.

No comments:

Post a Comment