android start Activity in adapter (transition animiation direction problem)

核能气质少年 提交于 2019-12-08 11:12:53

问题


I was having the problem in here : How to start Activity in adapter? . however, i would like to modify the transition animation direction. since, inside an adapter, you cannot call overridePendingTransition(). So do you guys know how to do it by using context and intent?

also, i have an activity using my customized adapter, and do you guys know how to call my own function in activity from the adapter?

thank you so much! penny


回答1:


Sounds like you need to pass a Context into your adapter, can you override the constructor and pass one in then?




回答2:


((Activity)  context).overridePendingTransition(R.anim.slide_out_right,R.anim.slide_in_left);


来源:https://stackoverflow.com/questions/4215070/android-start-activity-in-adapter-transition-animiation-direction-problem

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