best practice for UI management in app with omnipresent tabbar
I'm working on an Android app having an always visible tabbar.
However, each tab potentially contains many nested "screens". Of course the back-button n开发者_开发问答eeds to handle this correctly.I've now spent most of the day finding out what's the best architecture to achieve this.
There are also several similar questions on stackoverflow, but I couldn't really find an answer working for me. Two proposals I found and tried out:- switch view, see here
- work with ActivityGroup, see here
Another approach I thought about is just implement all "screens" as normal activities and have them all have their own tabbar (but looking the same, so for the user it doesn't change).
I've seen that should be possible without too much redundant code by using include statement in layout xml and maybe create a common base class "CustomActivity" which configures the tabbar.However since I'm not yet experienced with Android, I wanted to ask here before spending more time with try and error style.
Is this an approach which makes sense? If not, what would be a better solution? Btw: The proposals mentioned above didn't work for me mainly because with neither the back button worked for me.Thanks for every input!
Use Fragments API, ActivityGroup seems to be deprecated.
精彩评论