I need the equivalent code of setTimeOut(call function(),milliseconds);
for android.
setTimeOut(call function(),milliseconds);
This is the code that i used in my current project. I used TimerTask as Matt said. 60000 is the milisec. = 60 sec. i used it to refresh match scores.
private void refreshTimer() {
autoUpdate = new Timer();
autoUpdate.schedule(new TimerTask() {
@Override
public void run() {
runOnUiThread(new Runnable() {
public void run() {
adapter = Score.getScoreListAdapter(getApplicationContext());
adapter.forceReload();
setListAdapter(adapter);
}
});
}
}, 0, 60000);