TabActivity getTabHost - top ranked examples from Open Source projects

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

This code example shows how to use the following methods:getTabHost
@RunWith(TestRunners.WithDefaults.class) 
public class TabActivityTest { 
 
    @Test 
    public void tabActivityShouldNotMakeNewTabHostEveryGet() throws Exception { 
        TabActivity activity = new TabActivity();
        TabHost tabHost1 = activity.getTabHost();
        TabHost tabHost2 = activity.getTabHost();
 
        assertThat(tabHost1).isEqualTo(tabHost2);
    } 
 
    @Test 
    public void shouldGetTabWidget() throws Exception { 
        TabActivity activity = new TabActivity();
        activity.setContentView(R.layout.tab_activity);
        assertThat(activity.getTabWidget()).isInstanceOf(TabWidget.class);
    } 
} 
7
CodeRank
This code example shows how to use the following methods:getTabHost
     
     
    // move List 
    public void moveList(){ 
    	TabActivity parentTabActivity = (TabActivity)getParent();
    	TabHost tabHost = parentTabActivity.getTabHost();
    	tabHost.setCurrentTabByTag("listMain");
    } 
 
    // move notePad 
    public void moveNotePad(){ 
    	TabActivity parentTabActivity = (TabActivity)getParent();
    	TabHost tabHost = parentTabActivity.getTabHost();
    	tabHost.setCurrentTabByTag("notePadList");
    } 
 
} 
4
CodeRank
This code example shows how to use the following methods:getTabHost
		highlightOverlay.doHighlight((int) stop.getLatitude(),
				(int) stop.getLongitude(), mapView);
 
		// Switch to this tab 
		TabActivity t = (TabActivity) getParent();
		t.getTabHost().setCurrentTab(0);
 
		mapView.invalidate();
 
	} 
 
	class MapViewIntentReceiver extends BroadcastReceiver {
 
		@Override 
		public void onReceive(Context context, Intent intent) {
 
			if (intent.getAction().equals(MapHighlightOverlay.HIGHLIGHT_INTENT)) {
 
				Log.i("HighlightIntentReceiver", "Got highlight message!");
				BusStop stop = (BusStop) intent
4
CodeRank
This code example shows how to use the following methods:getTabHost
		// Set tab to first tab (subjects) 
		TabActivity tabActivity = (TabActivity) getParent();
		if (tabActivity != null)
		{ 
			 
			TabHost tabHost = tabActivity.getTabHost();
			tabHost.setCurrentTab(0);
		} 
	} 
 
	@Override 
	public void onResume() 
	{ 
		super.onResume(); 
		context = this;
		refreshContent(); 
	} 
 
	@Override 
	public void onPause() 
4
CodeRank
This code example shows how to use the following methods:getTabHost
						new DialogInterface.OnClickListener() {
 
							public void onClick(DialogInterface dialog,
									int which) {
								TabActivity tabs = (TabActivity) getParent();
								tabs.getTabHost().setCurrentTab(1);
 
							} 
						}); 
				alertDialog.show();
				apagarDados(); 
			} 
			 
			else{ 
				AlertDialog.Builder alertDialogFalha = new AlertDialog.Builder(
						AnuncioCaronaActivity.this);
				alertDialogFalha.setMessage("Todos os campos são obrigatórios");
				alertDialogFalha.show();
			} 
		} 
3
CodeRank
This code example shows how to use the following methods:getTabHost
    } 
     
    // move Voice Player 
    public void moveVoicePlayer(){ 
    	TabActivity parentTabActivity = (TabActivity)getParent();
    	TabHost tabHost = parentTabActivity.getTabHost();
    	tabHost.setCurrentTabByTag("voicePlayerMain");
    } 
 
} 
4
CodeRank
This code example shows how to use the following methods:getTabHost
	} 
 
	private void toNextActivity(int paramInt, String tag, String label) {
		Intent nextActivity = this.arrayIntent[paramInt];
		TabActivity tabActivity = (TabActivity) getParent();
		TabHost.TabSpec tab_spec_music_list = tabActivity.getTabHost()
				.newTabSpec(tag).setIndicator(label);
		tab_spec_music_list.setContent(nextActivity);
		tabActivity.getTabHost().addTab(tab_spec_music_list);
		tabActivity.getTabHost().setCurrentTabByTag(tag);
	} 
 
	@Override 
	protected void onListItemClick(ListView paramListView, View paramView,
			int paramInt, long paramLong) {
		super.onListItemClick(paramListView, paramView, paramInt, paramLong);
		switch (paramInt) {
		case 0: { 
			toNextActivity(paramInt, Constants.TAB_SPEC_TAG.AUDIO_LIST_SPEC_TAG
					.getId(), Constants.TAB_SPEC_TAG.AUDIO_LIST_SPEC_TAG 
4
CodeRank

Related TabActivity getTabHost Questions & Answers:

Other TabActivity getTabHost Examples

13:	        setContentView(R.layout.main);
14:	        
15:	        TabHost tabHost = getTabHost();
16:	        
17:	        // Tab for Photos

Read More

17:	        setContentView(R.layout.main);
18:	        
19:	        TabHost tabHost = getTabHost();
20:	        
21:	        // Inbox Tab

Read More

getTabHost Method Overview
Returns the TabHost the activity is using to host its tabs.
See Code Examples for other Android TabActivity Methods: