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?
thanks.
You should create a class let say
MyBaseActivity
that extendsActivity
and in that class take care of displaying that menu etc.Then you should let all your
Activities
in your application extend your customMyBaseActivity
.It depends on how the bottom line should behave on activity changes. If you want it not to move, you habe to use fragments. For pre-Honeycomb devices you'll need the
Android Compatibility package
provided in the SDK.If you don't care that the bottom line will be destroyed and recreated on every change of activity, your way to go is as
Ovidiu Latcu
wrote extending aBaseActivity
which provides just the bottom line.