Code example for TimerTask

Methods: cancel

0
    } 
 
    protected void centerMapObject(final AndroidMapObject mapObject, boolean updateWithoutWait) {
        if(!updateWithoutWait) {
            if(this.updateTimerTask != null) {
                this.updateTimerTask.cancel();
            } 
            this.updateTimerTask = new TimerTask() {
                public void run() { 
                    centerMapObject(mapObject);
                    updateTimerTask = null;
                } 
            }; 
            timer.schedule(this.updateTimerTask, 700);
        } 
        else { 
            this.centerMapObject(mapObject);
        } 
    } 
 
    private void centerMapObject(AndroidMapObject mapObject) {