TabHost clearAllTabs - 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 clearAllTabs method.

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
Contextual code suggestions in your IDE  Get Codota for Java
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
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:clearAllTabs, getCurrentTab, setCurrentTab
 
	 
	@Override 
	protected void onResume() { 
		super.onResume(); 
		int currentTab = mTabHost.getCurrentTab();
		if(mTabHost==null) mTabHost=getTabHost();
		mTabHost.setCurrentTab(0);
		mTabHost.clearAllTabs();
		addTabs(); 
		mTabHost.setCurrentTab(currentTab);
	} 
 
	private void addTabs(){ 
		TabHost.TabSpec spec;  // Resusable TabSpec for each tab
		Intent intent;  // Reusable Intent for each tab
		long millis = new DateTime().getMillis();
 
 
		// Create an Intent to launch an Activity for the tab (to be reused) 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:addTab, clearAllTabs, newTabSpec
import android.widget.TabHost; 
 
public class MainActivity extends TabActivity {
	private void initializeTabs() { 
		TabHost tabHost = (TabHost)findViewById(android.R.id.tabhost);
		tabHost.clearAllTabs();
		TabHost.TabSpec spec;
		Intent intent;
		 
		intent = new Intent(this, MapActivity.class);
		spec = tabHost.newTabSpec("MapTab")
					.setIndicator("System Map")
					.setContent(intent);
		tabHost.addTab(spec);
		 
		intent = new Intent(this, StationListActivity.class);
		spec = tabHost.newTabSpec("ListTab")
					.setIndicator("Station List")
					.setContent(intent);
		tabHost.addTab(spec);

6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:addTab, clearAllTabs
	 *  
	 * @since 1.0 
	 */ 
	private void removeVmTab() { 
		try { 
			this.tabs.clearAllTabs();
			tabs.addTab(tabSpecDial);
			tabs.addTab(tabSpecContacts);
			tabs.addTab(tabSpecCallList);
		} 
		catch (NullPointerException e) {
			Log.i(TAG, "removeVmTab() -> "+e.toString());
		} 
		 
		this.vmTabVisible = false;
	} 
} 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:clearAllTabs
    	for(int i=0;i<titles.length;i++){
    		addTab(i);
    	} 
    }   
    public void removeTabs(){ 
    	mTabHost.clearAllTabs();
    } 
} 
 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:clearAllTabs
      public boolean onKeyDown(int keyCode, KeyEvent event) {
        switch (keyCode) {
        case KeyEvent.KEYCODE_BACK:
          /* perform cleanup */ 
          myMainActivity.mytabHost = getTabHost();
          myMainActivity.mytabHost.clearAllTabs();
 
          /* call System.gc */ 
          System.gc();
          myMainActivity.this.finish();
          return true; 
        default: 
          return false; 
        } 
      }// end onKeyDown 
    }// end myMainActivity 
3
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:clearAllTabs
    } 
     
    @Override 
    protected void onDestroy()  
    {  
    	mTabHost.clearAllTabs();
    	mTabHost = null;
    	 
    	 
    	super.onDestroy(); 
    } 
    private void initTabs() 
    { 
        mTabHost.clearAllTabs();
 
        Intent friendsIntent   = new Intent(this,   FacebookFriendsActivity.class);
        friendsIntent.putExtra("fromtabview", true);
         
        /* 
        Intent phonebookIntent   = new Intent(this,   FacebookPhonebookActivity.class); 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:clearAllTabs
    } 
     
    @Override 
    protected void onDestroy()  
    {  
    	mTabHost.clearAllTabs();
    	mTabHost = null;
    	 
    	 
    	super.onDestroy(); 
    } 
    private void initTabs() 
    { 
        mTabHost.clearAllTabs();
 
        Intent friendsIntent   = new Intent(this,   FacebookFriendsActivity.class);
        friendsIntent.putExtra("fromtabview", true);
         
        /* 
        Intent phonebookIntent   = new Intent(this,   FacebookPhonebookActivity.class); 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:clearAllTabs
    } 
     
    @Override 
    protected void onDestroy()  
    {  
    	mTabHost.clearAllTabs();
    	mTabHost = null;
    	 
    	 
    	super.onDestroy(); 
    } 
    private void initTabs() 
    { 
        mTabHost.clearAllTabs();
 
        Intent friendsIntent   = new Intent(this,   FacebookFriendsActivity.class);
        friendsIntent.putExtra("fromtabview", true);
         
        /* 
        Intent phonebookIntent   = new Intent(this,   FacebookPhonebookActivity.class); 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java

Related TabHost clearAllTabs Questions & Answers:

clearAllTabs Method Overview
Removes all tabs from the tab widget associated with this tab host.
See Code Examples for other Android TabHost Methods: