ActivityGroup中使用切换动画

ActivityGroup中使用切换动画
在stack上面发现的方法,分享给大家,功能是在activitygroup切换子activity时候加载补间动画,代码如下:

	public void replaceContentView(String id, Intent newIntent) {
		View view = getLocalActivityManager().startActivity(id,
				newIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP))
				.getDecorView();
		Animation hyperspaceJump = AnimationUtils.loadAnimation(this,
				R.anim.myanimation);
		view.startAnimation(hyperspaceJump);
		history.add(view);
		this.setContentView(view);
	}
posted @ 2013-01-29 14:37  GreyWolf  阅读(195)  评论(0编辑  收藏  举报