Last active
July 27, 2016 09:07
-
-
Save RafalSladek/09e921ac9eaa3e12ca9769294eaafeed to your computer and use it in GitHub Desktop.
Android Java - run code every x milliseconds, postDelayed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| final Handler handler = new Handler(); | |
| Runnable run = new Runnable() { | |
| @Override | |
| public void run() { | |
| // insert code to be run every 1000 milliseconds | |
| handler.postDelayed(this, 1000); | |
| } | |
| }; | |
| handler.post(run); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment