Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Fragment Tabs Example

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?

like image 545
Rookie Avatar asked Apr 30 '12 11:04

Rookie


People also ask

How do I create a tab in Android?

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.

What is difference between ViewPager and ViewPager2?

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 .


1 Answers

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

like image 53
wyoskibum Avatar answered Oct 25 '22 05:10

wyoskibum