Code example for ViewAnimator

Methods: setAnimationaddViewremoveAllViewssetDisplayedChild

0
		viewSwiter.setDisplayedChild(0);
		mainDC.onShow();
	} 
 
	public void setInitDC(BaseDC initDC) {
		viewSwiter.removeAllViews();
		viewSwiter.addView(initDC, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
		viewSwiter.setAnimation(scaleAnimation);
		viewSwiter.setDisplayedChild(0);
		initDC.onShow();
	} 
 
	/** 
	 * 用于设置到activity中 
	 *  
	 * @author haitian 
	 */ 
	public ViewAnimator getContentView() {
		if (viewSwiter.getCurrentView() instanceof BaseDC) {
			((BaseDC) viewSwiter.getCurrentView()).checkOrientation();
Stop searching for code, let great code find you!  Add Codota to your java IDE