Switching between activities with java animation (defined programmatically)

旧时模样 提交于 2020-01-15 11:07:10

问题


If i have my animations defined in xml then i can animate between activities like

//Calls a new Activity  
startActivity(new Intent(this, NewActivity.class));  

//Set the transition -> method available from Android 2.0 and beyond  
overridePendingTransition(R.anim.push_left_in,R.anim.push_up_out);  

But I have my animation defined in Java. Function "overridePendingTransition(int , int)" takes int arguments for animations. How can I use programmatically defined animations instead?


回答1:


I Found out solution for this here http://blog.robert-heim.de/karriere/android-startactivity-rotate-3d-animation-activityswitcher/comment-page-1/#comment-12025



来源:https://stackoverflow.com/questions/11002219/switching-between-activities-with-java-animation-defined-programmatically

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!