Code example for Handler

Methods: sendEmptyMessageDelayed

0
			if (level >= 0 && level < transitionDrawableLength) { 
				transitionDrawable.setLevel(level); 
		        if (colors != null) { 
		        	setTextColor(colors[level]); 
		        } 
				handler.sendEmptyMessageDelayed(what, DELAY); 
			} else { 
				level = Math.max(0, level); 
				level = Math.min(transitionDrawableLength-1, level); 
			} 
		} 
	}; 
	 
	public void setTransitionDrawable(Drawable drawable, int length) {
		transitionDrawable = (LevelListDrawable) drawable;
		transitionDrawableLength = length;
		level = 0;
		invalidate();
	} 
}