android在适配器中启动Activity(过渡动画方向问题)

发布于 2024-10-03 07:34:10 字数 279 浏览 0 评论 0原文

我在这里遇到问题: 如何在适配器中启动 Activity? 。但是,我想修改过渡动画方向。因为在适配器内部,您无法调用 overridePendingTransition()。那么你们知道如何利用上下文和意图来做到这一点吗?

另外,我有一个使用自定义适配器的活动,你们知道如何从适配器调用活动中我自己的函数吗?

太感谢了! 一分钱

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

橘亓 2024-10-10 07:34:10

听起来您需要将 Context 传递到适配器中,您可以重写构造函数并传递一个吗?

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

软甜啾 2024-10-10 07:34:10
((Activity)  context).overridePendingTransition(R.anim.slide_out_right,R.anim.slide_in_left);
((Activity)  context).overridePendingTransition(R.anim.slide_out_right,R.anim.slide_in_left);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文