Running Tabs from java code not XML

SBrenCollinsF

New Member
What I have right now is 4 tabs, one of them has a custom view and some widgets on it. In order for that whole thing to work I need to start the activity \[code\]Tab3Activity\[/code\] and then it runs correctly (I know this because I have set the default activity to that in the manifest) but what I have right now is the tabs run from xml files... this is what I have.\[code\] th.setup(); TabSpec specs = th.newTabSpec("tag0"); specs.setContent(R.id.connecttionTab); specs.setIndicator("Connection Tab"); th.addTab(specs); specs = th.newTabSpec("tag1"); specs.setContent(R.id.tab1); specs.setIndicator("Zone Manager"); th.addTab(specs); specs = th.newTabSpec("tag2"); specs.setContent(R.id.tab2); specs.setIndicator("",res.getDrawable(R.drawable.ic_tab_vaccontrol)); th.addTab(specs); specs = th.newTabSpec("tag3"); specs.setContent(R.id.tab3); specs.setIndicator("Graphical Layout"); th.addTab(specs);\[/code\]this is the activity that needs to be started for this tab to work correctly...\[code\]public class Tab3Activity extends Activity { private Tab3 mTab3; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.tab3); mTab3 = (Tab3) findViewById(R.id.tab3_display); } public void onAddZone(View view) { mTab3.addZone(); }}\[/code\]how do I start this tab from a java file such as that but the rest of them stay starting from XML?
 
Back
Top