Skip to content

TickTask

Carlyle-Lee edited this page May 11, 2020 · 1 revision

public TickTask setMaxLoopTime(int loopTime)
Set max loop time.

public TickTask setIntervalWithFixedDelay(int time)
"onTick" will be called again after "time" in million seconds.

public TickTask setIntervalWithFixedRate(int time)
"onTick" is set to be called every "time" in million seconds.

protected abstract void onTick(int loopTime)
to be implemented.

public void stop()
Stop looping.

new TickTask(){
            @Override
            public void onTick(int loopTime) {
                // do sth
            }
        }.setMaxLoopTime(199)
                .setIntervalWithFixedDelay(200)
                .postUI();
Clone this wiki locally