Hello I have the following code already i have the explanation on what i want to do within the code
Code:
public class Main extends Activity implements OnClickListener {
TabHost th;
TextView showResults;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
th = (TabHost) findViewById(R.id.tabhost);
Button newTab = (Button) findViewById(R.id.bVanilla);
newTab.setOnClickListener(this);
th.setup();
TabSpec specs = th.newTabSpec("Main");
specs.setContent(R.id.tab1);
specs.setIndicator("Main");
th.addTab(specs);
}
public void onClick(View arg0) {
switch (arg0.getId()) {
case R.id.bVanilla:
TabSpec ourSpec = th.newTabSpec("tabVanilla");
ourSpec.setContent(new TabHost.TabContentFactory() {
public View createTabContent(String tag) {
TextView text = new TextView(Main.this);
text.setText("text line one\n");
/* after this print oh line 1 i want to
display a image for example test.png
then break a line then another line of
text then break again then another image
was wondering if it would be easier to do this with an 2
arrays one for text and one for images
but not sure how I would achieve this
greatly appreciate the help
*/
return (text);
}
});
ourSpec.setIndicator("New");
th.addTab(ourSpec);
break;
}
}
}