Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

équivalent setTimeInterval java

// Param is optional, to run task on UI thread.     
Handler handler = new Handler(Looper.getMainLooper());
Runnable runnable = new Runnable() {
    @Override
    public void run() {
        // Do the task...
        handler.postDelayed(this, milliseconds) // Optional, to repeat the task.
    }
};
handler.postDelayed(runnable, milliseconds);

// Stop a repeating task like this.
handler.removeCallbacks(runnable);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #setTimeInterval #java
ADD COMMENT
Topic
Name
3+5 =