我的模拟器和我的手机一样运行2.2
这是我的onCreate方法
public voID onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentVIEw(R.layout.main); final button button = (button) findVIEwByID(R.ID.close); button.setonClickListener(new VIEw.OnClickListener() { public voID onClick(VIEw v) { Intent myIntent = new Intent(ActivityTransitionActivity.this,ActivityTwo.class); ActivityTransitionActivity.this.startActivity(myIntent); overrIDePendingTransition(R.anim.fadein,R.anim.fadeout); } }); }解决方法 在style.xml中定义动画
<style name="Animation.CustomAnimation"> <item name="androID:activityOpenEnteranimation">@anim/slIDe_in_left</item> When opening a new activity,this is the animation that is run on the next activity <item name="androID:activityOpenExitAnimation">@anim/slIDe_out_right</item>When opening a new activity,this is the animation that is run on the prevIoUs activity (which is exiting the screen) <item name="androID:activityCloseEnteranimation">@anim/slIDe_in_right</item>When closing the current activity,this is the animation that is run on the next activity (which is entering the screen). <item name="androID:activityCloseExitAnimation">@anim/slIDe_out_left</item>When closing the current activity,this is the animation that is run on the current activity (which is exiting the screen). </style><style parent="androID:style/theme.light.NoTitlebar.Fullscreen" name="app_theme"> <item name="androID:windowBackground">@drawable/splash</item> <item name="androID:windowAnimationStyle">@style/Animation.CustomAnimation</item> </style>
<application androID:icon="@drawable/icon" androID:label="@string/app_name" androID:theme="@style/app_theme">
将app_theme应用于AndroID清单中的应用程序
总结以上是内存溢出为你收集整理的在Android活动之间运行自定义动画全部内容,希望文章能够帮你解决在Android活动之间运行自定义动画所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)