How to make Android tab layout

Android tab layout

Here we demonstrate article about how to build Android tab layout with image and text.
Android tab layout example

Download Code Download APK

Let’s get started with eclipse IDE.

  • Create new project-> File->New -> Android Project and give activity AndroidTabActivity.
  • Open your AndroidTabActivity and extend TabActivity.

Create 4 class in src folder that extend activity and give name according to follow HomeActivity, MoreActivity, AccountActivity, SearchActivity, and type following code respectively.

Here we need three dimension of each icon so i have design each icon in 48 x 48px and then place into drowable hdpi folder you have to design each icon according to other drawable folder.

Now for 4 icons we need the icon state configuration files that define how to change state of icon. So create three 4 xml files in drawable directory. Type the following code.





  • open your activity_main file in folder res-> layout and code as following.

Now create 4 Layout respectively according to our activity. account_layout.xml, home_layout.xml, more_layout.xml, search_layout.xml, and type following code.





Now All ok and one final things have to do define all activity in AndroidManifest file, as listed bellow.


finally run Android tab layout project using Run As-> Android Application.