Here is a long shot, and I never tried to see if it works:
- Create a custom class that contains
onClick methods for elements in the footer. import this class in every Activity you have; - Use
android:onClick in the attached XML file with values pointing to methods in this class.
Now I'm not sure that this class should be created in every Activity , or if you can use its methods as static, but something like this should work, and this is better than adding listeners to each activity.
In my opinion (and I emphasize that this is only my opinion), this interface paradigm, as you call it, is a poor attempt to copy the iPhone. This paradigm is very popular on the iPhone, mainly because it has only one button. I even hate the Engadget app for this (and again, it's copied from the iPhone app) - it distracts the screen real estate.
In short, my advice is: use the MENU button . p>
Last note: it has never been played with TabLayout , but if you want a separate Activity on each tab, then I am 99.9% sure that you can not do this (you can not insert whole actions in any view or ViewGroup ). TabLayout only contains children of Layout s, not actions. In addition, with TabLayout you can say goodbye to the BACK button (are you going to spend another button to copy the user interface from the iPhone?) - if you do not plan to redefine it, in which case you can say goodbye to your users.
Felix
source share