enricozhang
enricozhang

Reputation: 11

How can change my TabHost?

I have a tabhost, e.g:

final TabHost tabs = getTabHost();
tabs.setup();
TabHost.TabSpec spec = null;
spec = tabs.newTabSpec("search");
spec.setContent(new Intent(this, Search.class));
spec.setIndicator("search");
tabs.addTab(spec);

in this tabhost is a Intent,and in the activity must change to other activity, question is I hope the other actitivy at same tabhost switch? Can do this?

Upvotes: 1

Views: 708

Answers (1)

Praveen
Praveen

Reputation: 91175

I had this problem almost a 3 months ago. you can not replace the activity. Because activities are open in new screens. so you have to use the views and layout to achieve what you are want to do. use the setVisiblity and isShown methods you can hide and release yours view. Hope it make some sense on it.

Upvotes: 2

Related Questions