Android TabActivity - top ranked examples from Open Source projects

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

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
This code example shows how to use the following methods:
package com.proyectoAndroid.musicbox; 
 
import android.app.TabActivity; 
import android.content.Intent; 
import android.os.Bundle; 
import android.widget.TabHost; 
 
 
public class Usuario extends opcionesMenu{	 
	TabActivity tabActivity = new TabActivity();
	public static final String U_INFORMACION = "Informaci—n";
	public static final String U_CANCION = "Subir Canci—n";
	Intent intentInfo = new Intent(this, Informacion.class);
	Intent intentCancion = new Intent(this, Cancion.class);
	 
	@Override 
	public void onCreate(Bundle savedInstanceState){
		super.onCreate(savedInstanceState);
		setContentView(R.layout.usuario); 
		TabHost tabHost = tabActivity.getTabHost();

4
CodeRank

Related Android TabActivity Questions & Answers:

Other Android TabActivity Examples

6:	import android.widget.TabHost.TabSpec;
7:	
8:	public class AndroidTabLayoutActivity extends TabActivity {
9:	    /** Called when the activity is first created. */
10:	    @Override

Read More

6:	import android.widget.TabHost.TabSpec;
7:	
8:	public class AndroidTabAndListView extends TabActivity {
9:		// TabSpec Names
10:		private static final String INBOX_SPEC = "Inbox";

Read More

See Code Examples for Android TabActivity Methods: