TabHost newTabSpec - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for TabHost newTabSpec method.

This code example shows how to use the following methods:addTab, clearAllTabs, newTabSpec, setCurrentTab
			setExtras(extras, backlog, "backlog");
			setExtras(extras, current, "current");
			setExtras(extras, icebox, "icebox");
		} 
 
		tabHost.clearAllTabs();
		tabHost.addTab(tabHost.newTabSpec("tab_done")
				.setIndicator("Done")
				.setContent(done));
		tabHost.addTab(tabHost.newTabSpec("tab_current")
				.setIndicator("Current")
				.setContent(current));
		tabHost.addTab(tabHost.newTabSpec("tab_backlog")
				.setIndicator("Backlog")
				.setContent(backlog));
		tabHost.addTab(tabHost.newTabSpec("tab_icebox")
				.setIndicator("Icebox")
				.setContent(icebox));
		 
		tabHost.setCurrentTab(1);

7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:addTab, newTabSpec, setOnTabChangedListener, setup
	/** 
	 * Initialise the Tab Host 
	 */ 
	private void initialiseTabHost(Bundle args) {
		mTabHost = (TabHost)findViewById(android.R.id.tabhost);
        mTabHost.setup();
        TabInfo tabInfo = null;
        TabsFragmentActivity.addTab(this, this.mTabHost, this.mTabHost.newTabSpec("Tab1").setIndicator("Tab 1"), ( tabInfo = new TabInfo("Tab1", Tab1Fragment.class, args)));
        this.mapTabInfo.put(tabInfo.tag, tabInfo);
        TabsFragmentActivity.addTab(this, this.mTabHost, this.mTabHost.newTabSpec("Tab2").setIndicator("Tab 2"), ( tabInfo = new TabInfo("Tab2", Tab2Fragment.class, args)));
        this.mapTabInfo.put(tabInfo.tag, tabInfo);
        TabsFragmentActivity.addTab(this, this.mTabHost, this.mTabHost.newTabSpec("Tab3").setIndicator("Tab 3"), ( tabInfo = new TabInfo("Tab3", Tab3Fragment.class, args)));
        this.mapTabInfo.put(tabInfo.tag, tabInfo);
        // Default to first tab 
        this.onTabChanged("Tab1");
        // 
        mTabHost.setOnTabChangedListener(this);
	} 
	 
	/** 

7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:addTab, clearAllTabs, newTabSpec
 
	private void setupTabs() { 
		Intent projects = new Intent(this, Projects.class);
		Intent activities = new Intent(this, Activities.class);
 
		tabHost.clearAllTabs();
 
		tabHost.addTab(tabHost.newTabSpec("tab_projects")
				.setIndicator("My Projects")
				.setContent(projects));
 
		tabHost.addTab(tabHost.newTabSpec("tab_activities")
				.setIndicator("Activity Feed")
				.setContent(activities));
 
	} 
} 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:addTab, newTabSpec, setOnTabChangedListener, setup
	/** 
	 * Initialise the Tab Host 
	 */ 
	private void initialiseTabHost(Bundle args) {
		mTabHost = (TabHost)findViewById(android.R.id.tabhost);
        mTabHost.setup();
        TabInfo tabInfo = null;
        TabsViewPagerFragmentActivity.AddTab(this, this.mTabHost, this.mTabHost.newTabSpec("Tab1").setIndicator("Tab 1"), ( tabInfo = new TabInfo("Tab1", Tab1Fragment.class, args)));
        this.mapTabInfo.put(tabInfo.tag, tabInfo);
        TabsViewPagerFragmentActivity.AddTab(this, this.mTabHost, this.mTabHost.newTabSpec("Tab2").setIndicator("Tab 2"), ( tabInfo = new TabInfo("Tab2", Tab2Fragment.class, args)));
        this.mapTabInfo.put(tabInfo.tag, tabInfo);
        TabsViewPagerFragmentActivity.AddTab(this, this.mTabHost, this.mTabHost.newTabSpec("Tab3").setIndicator("Tab 3"), ( tabInfo = new TabInfo("Tab3", Tab3Fragment.class, args)));
        this.mapTabInfo.put(tabInfo.tag, tabInfo);
        // Default to first tab 
        //this.onTabChanged("Tab1"); 
        // 
        mTabHost.setOnTabChangedListener(this);
	} 
	 
	/** 

6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:addTab, newTabSpec, setCurrentTab
  private String serialid;
 
  public void addTab() 
  { 
    this.mTabHost = getTabHost();
    TabHost.TabSpec localTabSpec1 = this.mTabHost.newTabSpec("BrandGoodReputationActivity");
    Intent localIntent1 = new Intent(this, BrandGoodReputationActivity.class);
    localIntent1.putExtra("serialid", this.serialid);
    localTabSpec1.setContent(localIntent1);
    localTabSpec1.setIndicator("", getResources().getDrawable(2130837733));
    this.mTabHost.addTab(localTabSpec1);
    TabHost.TabSpec localTabSpec2 = this.mTabHost.newTabSpec("BrandNeutralReputationActivity");
    Intent localIntent2 = new Intent(this, BrandNeutralReputationActivity.class);
    localIntent2.putExtra("serialid", this.serialid);
    localTabSpec2.setContent(localIntent2);
    localTabSpec2.setIndicator("", getResources().getDrawable(2130837733));
    this.mTabHost.addTab(localTabSpec2);
    TabHost.TabSpec localTabSpec3 = this.mTabHost.newTabSpec("BrandBadReputationActivity");
    Intent localIntent3 = new Intent(this, BrandBadReputationActivity.class);
    localIntent3.putExtra("serialid", this.serialid);

6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:addTab, newTabSpec, setup
		setTabView(); 
	} 
	 
	private void setTabView(){ 
		tabHost = (TabHost)findViewById(android.R.id.tabhost);
		tabHost.setup();
		 
		TabHost.TabSpec spec1 = tabHost.newTabSpec("tag1");
		spec1.setContent(new Intent(this, SmsWatcherActivity.class));
		spec1.setIndicator("HOME");
		 
		tabHost.addTab(spec1);
		 
		TabHost.TabSpec spec2 = tabHost.newTabSpec("tag2");
		spec2.setContent(new Intent(this, SmsListActivity.class));
		spec2.setIndicator("WATCHING LIST");
		 
		tabHost.addTab(spec2);
		 
		TabHost.TabSpec spec3 = tabHost.newTabSpec("tag3");

6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:addTab, newTabSpec, setCurrentTab
 
		super.onCreate(savedInstanceState);
 
		tabHost = getTabHost();
 
		tabHost.addTab(tabHost
				.newTabSpec(eu.fbk.dycapo.activities.Settings.TAB_TAGS[0])
				.setContent(new Intent(this, Me.class))
				.setIndicator(
						eu.fbk.dycapo.activities.Settings.TAB_TAGS[0],
						getResources().getDrawable(
								android.R.drawable.ic_menu_info_details)));
		tabHost.addTab(tabHost
				.newTabSpec(eu.fbk.dycapo.activities.Settings.TAB_TAGS[1])
				.setContent(new Intent(this, Prefs.class))
				.setIndicator(
						eu.fbk.dycapo.activities.Settings.TAB_TAGS[1],
						getResources().getDrawable(
								android.R.drawable.ic_menu_preferences)));
		tabHost.addTab(tabHost

6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:addTab, newTabSpec, setup
	 *  
	 * Initializes or instantiates all tabs.  
	 */ 
	private void initializeTabbedView(){ 
		tabHost = getTabHost();
		tabHost.setup();
		//if(!LoadProject.loadFile_boolean){ 
			instantiateHomeTab(); 
			instantiateProjectTab(); 
			instantiateEnvelopeTab(); 
			instantiateMechanicalTab(); 
			tabHost.addTab(homeTab);
			tabHost.addTab(projectTab);
			tabHost.addTab(envelopeTab);
			tabHost.addTab(mechanicalTab);
		//} 
	} 
	 
	/** 
	 * instantiateHomeTab Method 

6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:addTab, newTabSpec
 
        // create intent to be invoked on tab press 
        final Intent intent = new Intent().setClass(context, activityClass);
 
        // init TabSpec 
        final TabHost.TabSpec tabSpec = tabHost.newTabSpec(tabId).setIndicator(context.getString(tabCaptionId)).setContent(intent);
 
        tabHost.addTab(tabSpec);
    } 
 
    public static int toPixels(@Nonnull DisplayMetrics dm, float dps) {
        final float scale = dm.density;
        return (int) (dps * scale + 0.5f);
    } 
 
    public static int getScreenOrientation(@Nonnull Activity activity) {
        final Display display = activity.getWindowManager().getDefaultDisplay();
 
        final int result;
 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:addTab, newTabSpec, setCurrentTabByTag
    super.onCreate(paramBundle);
    requestWindowFeature(1);
    setContentView(2130903104);
    this.b = ((RadioGroup)findViewById(2131231031));
    this.c = getTabHost();
    this.c.addTab(this.c.newTabSpec("tab1").setIndicator(getString(2131429126)).setContent(new Intent(this, SoftwareManager2.class)));
    this.c.addTab(this.c.newTabSpec("tab2").setIndicator(getString(2131429127)).setContent(new Intent(this, APKManagerActivity.class)));
    this.b.setOnCheckedChangeListener(new aw(this));
    this.c.setCurrentTabByTag("tab1");
    ((RadioButton)findViewById(2131231032)).setChecked(true);
  } 
} 
 
/* Location:           C:\Users\sandrocheng.21KUNPENG\Desktop\classes_dex2jar\ 
 * Qualified Name:     com.keniu.security.software.SoftwareManagerTabActivity 
 * JD-Core Version:    0.6.2 
 */ 
6
CodeRank
Experience pair programming with AI  Get Codota for Java

Related TabHost newTabSpec Questions & Answers:

Other TabHost newTabSpec Examples

16:	        
17:	        // Tab for Photos
18:	        TabSpec photospec = tabHost.newTabSpec("Photos");
19:	        // setting Title and Icon for the Tab
20:	        photospec.setIndicator("Photos", getResources().getDrawable(R.drawable.icon_photos_tab));
-
23:	        
24:	        // Tab for Songs
25:	        TabSpec songspec = tabHost.newTabSpec("Songs");        
26:	        songspec.setIndicator("Songs", getResources().getDrawable(R.drawable.icon_songs_tab));
27:	        Intent songsIntent = new Intent(this, SongsActivity.class);
-
29:	        
30:	        // Tab for Videos
31:	        TabSpec videospec = tabHost.newTabSpec("Videos");
32:	        videospec.setIndicator("Videos", getResources().getDrawable(R.drawable.icon_videos_tab));
33:	        Intent videosIntent = new Intent(this, VideosActivity.class);

Read More

20:	        
21:	        // Inbox Tab
22:	        TabSpec inboxSpec = tabHost.newTabSpec(INBOX_SPEC);
23:	        // Tab Icon
24:	        inboxSpec.setIndicator(INBOX_SPEC, getResources().getDrawable(R.drawable.icon_inbox));
-
28:	        
29:	        // Outbox Tab
30:	        TabSpec outboxSpec = tabHost.newTabSpec(OUTBOX_SPEC);
31:	        outboxSpec.setIndicator(OUTBOX_SPEC, getResources().getDrawable(R.drawable.icon_outbox));
32:	        Intent outboxIntent = new Intent(this, OutboxActivity.class);
-
34:	        
35:	        // Profile Tab
36:	        TabSpec profileSpec = tabHost.newTabSpec(PROFILE_SPEC);
37:	        profileSpec.setIndicator(PROFILE_SPEC, getResources().getDrawable(R.drawable.icon_profile));
38:	        Intent profileIntent = new Intent(this, ProfileActivity.class);

Read More

newTabSpec Method Overview
Get a new TabHost.TabSpec associated with this tab host.
See Code Examples for other Android TabHost Methods: