I am currently working on 2.3 version of android and I want to switch my app to 4.0 version but the TabActivity
is deprecated. So I was looking for working example of FragmentTabs
but I am not able to find one. Can anyone help?
Tabs are created using newTab() method of TabLayout class. The title and icon of Tabs are set through setText(int) and setIcon(int) methods of TabListener interface respectively. Tabs of layout are attached over TabLayout using the method addTab(Tab) method.
ViewPager2 is an improved version of the ViewPager library that offers enhanced functionality and addresses common difficulties with using ViewPager . If your app already uses ViewPager , read this page to learn more about migrating to ViewPager2 .
I've found the FragmentTabs
example from the API Demos project to be very useful.
Just create a new Android sample project from Eclipse and choose the API demos (try API 13). Also for the support (compatibility) library, there's a FragmentTabs demo in the Support4Demos
also refer this link Android-FragmentTabHost-demo
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