Code example for TabHost.TabSpec

Methods: setContent, setIndicator

0
     
    private void addTabPendents() { 
        Intent intent = new Intent(this, NotFinishedCatTaskOverviewActivity.class);
        intent.putExtra("id", id);
        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, FinishedCatTaskOverviewActivity.class);
         intent.putExtra("id", id);
         TabSpec spec = mTabHost.newTabSpec("Completades");
         spec.setIndicator("Completades", mResources
                           .getDrawable(android.R.drawable.ic_menu_agenda));
         spec.setContent(intent);
         mTabHost.addTab(spec);
     }