Code example for TabHost.TabSpec

Methods: setContent, setIndicator

0
     } 
     
    private void addTabPendents() { 
        Intent intent = new Intent(this, NotFinishedTasksOverviewActivity.class);
        TabSpec spec = mTabHost.newTabSpec("Pendents");
        spec.setIndicator("Pendents", mResources
                          .getDrawable(android.R.drawable.ic_menu_agenda));
        spec.setContent(intent);
        mTabHost.addTab(spec);
     }  
     
    private void addTabCompletades() { 
         Intent intent = new Intent(this, FinishedTasksOverviewActivity.class);
         TabSpec spec = mTabHost.newTabSpec("Completades");
         spec.setIndicator("Completades", mResources
                           .getDrawable(android.R.drawable.ic_menu_agenda));
         spec.setContent(intent);
         mTabHost.addTab(spec);
     }