所有活动中都使用相同的 SlideDrawer 吗?

发布于 2024-12-25 13:55:45 字数 120 浏览 1 评论 0原文

我的应用程序中有一个 slidingDrawer,其中包含所有活动都应访问的链接。是否可以创建一个 slidingDrawer 并将其扩展到所有活动?任何例子都会非常有帮助。

I have a slidingDrawer in my application that contains links which should be accessed by all activities. Is it possible to create a single slidingDrawer and extend it to all activities? Any example would be very helpful.

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

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

发布评论

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

评论(1

热风软妹 2025-01-01 13:55:45

我认为最好的选择是创建一个包含所有滑动抽屉逻辑的父类。父类将扩展活动并确保设置/填充您的滑动抽屉,数据可能是单例也以避免加载重复。然后你的所有活动都会扩展你的 SlidingDrawer 活动并做他们的事情。

I think your best bet would be to create a parent class with all of the sliding drawer logic. The parent class would extend activity and make sure to setup / populate your sliding drawer, the data could possibly be a singleton also to avoid load duplication. Then all of your activities would extend your SlidingDrawer activity and do their thing.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文