Code example for TabHost

Methods: setLayoutParamsaddViewsetOnTabChangedListenersetup

	public Widget create(Activity activity, int handle)
	     // Construct the tab host that fills the whole screen. 
        TabHost tabHost = new TabHost( activity, null );
        		new LinearLayout.LayoutParams(
                        LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT ) );
        // Create the visual structure of the tab host 
        LinearLayout tabRootView = createTabRoot( activity );
        tabHost.addView( tabRootView );
        // Must be called when using views instead of activities to fill 
        // a tabs content 
        tabHost.setup( );
        tabHost.setOnTabChangedListener( new TabChangeListener( handle ) );
		return new TabScreenWidget( handle, tabHost );
	 * Creates the visual layout of the whole tabbed screen. 
Experience pair programming with AI  Get Codota for Java