在应用程序一般恒定的菜单 [英] General constant menu in the application

查看:92
本文介绍了在应用程序一般恒定的菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发一个Android应用程序与在其屏幕下方同样不变的菜单10个不同的活动。是片段是构建菜单或只是建立,所有的活动,继承它的基类的活动最好的方式?

I'm developing an Android application that has 10 different activities with the same constant menu at the bottom of their screen. Is fragments is the best way to build the menu or just build a base activity class that all the activities inherits from it?

感谢。

推荐答案

您应该创建一个类让说 MyBaseActivity 扩展活动,并在该类需要显示的菜单等服务。

You should create a class let say MyBaseActivity that extends Activity and in that class take care of displaying that menu etc.

然后,你应该让你的所有活动在您的应用程序扩展您的自定义 MyBaseActivity

Then you should let all your Activities in your application extend your custom MyBaseActivity.

这篇关于在应用程序一般恒定的菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆