public class AndroidTabLayoutActivity extends TabActivity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main);
TabHost tabHost = getTabHost();
// Tab for Photos TabSpec photospec = tabHost.newTabSpec("Photos"); // setting Title and Icon for the Tab photospec.setIndicator("Photos", getResources().getDrawable(R.drawable. Intent photosIntent = new Intent(this, PhotosActivity.class); photospec.setContent(photosIntent);
// Tab for Songs TabSpec songspec = tabHost.newTabSpec("Songs"); songspec.setIndicator("Songs", getResources().getDrawable(R.drawable.ic Intent songsIntent = new Intent(this, SongsActivity.class); songspec.setContent(songsIntent);
// Tab for Videos TabSpec videospec = tabHost.newTabSpec("Videos"); videospec.setIndicator("Videos", getResources().getDrawable(R.drawable. Intent videosIntent = new Intent(this, VideosActivity.class); videospec.setContent(videosIntent);