Code example for Timer

Methods: schedule

0
     * Method that reschedule the timer for hide the indicator 
     */ 
    @SuppressWarnings("synthetic-access") 
    private void rescheduleDimTimer() { 
        cancelHideTimer(); 
        this.mHideTimer = new Timer();
        this.mHideTimer.schedule(new HideTimerTask(), HIDE_INDICATOR_WAIT);
    } 
 
    /** 
     * Method that show the indicator 
     * 
     * @param fade While showing, makes a fade animation 
     */ 
    public void showIndicator(final boolean fade) {
        this.mRootView.startAnimation(
                AnimationUtils.loadAnimation(getContext(),
                                fade ? R.anim.dim
                                     : R.anim.dim_instant)); 
    }