Skip to content

Instantly share code, notes, and snippets.

View devxunes's full-sized avatar

Younes Bennour devxunes

  • WD
View GitHub Profile
@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(