There are many old questions here on the matter. And they all mention that the former mechanism is now deprecated. Is there a present means for created Tab based applications in android similar to how it's done in iOS, i.e. using UITabBar/UITabBarController?
If you are using Android studio, you can use it to generate up-to-date code samples for tabs.
file > new > activity > Tabbed activity
Generates an activity with a tabbar at the top, and uses Fragments for the tabs.
file > new > activity > Bottom Navigation Activity
Tabbar at the bottom. You will have to implement the tabbing yourself, I would recommend using Fragments here as well. You can generate fragments using file > new > Fragment, and learn how to swap them at runtime: https://developer.android.com/training/basics/fragments/fragment-ui.html#AddAtRuntime
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With