Skip to content

Instantly share code, notes, and snippets.

{
"name": "yiisoft/yii-project-template",
"type": "project",
"description": "Yii Framework Project Template",
"keywords": [
"yii",
"app",
"project",
"template"
],
@odai-alali
odai-alali / js_functions_equivalent.java
Created February 22, 2018 11:12
The equivalent to a JavaScript setInterval/setTimeout in Android/Java?
// setInterval()
new Timer().scheduleAtFixedRate(new TimerTask(){
@Override
public void run(){
Log.i("interval", "This function is called every 5 seconds.");
}
},0,5000);
// setTimeout()
new android.os.Handler().postDelayed(