我已经解决了。如果你需要帮助,这是我的电子邮件:emmets@foxmail.com。
XML布局:
XML布局:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<RelativeLayout
android:id="@+id/newLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
</RelativeLayout>
<RelativeLayout
android:id="@+id/oldLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
</RelativeLayout>
Java代码,需要扩展ActivityGroup:
LocalActivityManager localLocalActivityManager = getLocalActivityManager();
paramIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
Window localWindow = localLocalActivityManager.startActivity("flag", NewActivity.class);
localWindow.addFlags(1);
View localView = localWindow.getDecorView();
localView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT));
newLayout.addView(localView);
dAnimation upOut = AnimationUtils.loadAnimation(this, R.anim.push_up_out);
Animation zoomEnter = AnimationUtils.loadAnimation(this, R.anim.zoom_enter);
newLayout.startAnimation(zoomEnter);
oldLayout.startAnimation(upOut);