Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的应用程序中有一个slidingDrawer包含所有活动都应该访问的链接。是否可以创建单个slidingDrawer并将其扩展到所有活动?任何示例都会非常有帮助。
slidingDrawer
我认为你最好的选择是创建一个包含所有滑动抽屉逻辑的父类。父类将扩展活动并确保设置/填充您的滑动抽屉,数据也可能是单例以避免负载重复。然后你的所有活动都会扩展你的 SlidingDrawer 活动并做他们的事情。