开发者

Android - Change content view of TabHost

I try to create a android application with tabHost and I would like to avoid to set intent(activity) for the content of these tabs.

I succeed to create my tabMenu but I would like to change the view of one tab. How I can do that ?

For example I have one view for Tab1 and two views for Tab2 (when the user click on the button of Tab2_view1 then the content change to Tab2_view2 and the indicator doesn't change (stay on "tab2")).

I hope it is possible but I don't find the way to do that without using different activities for each tabs. Maybe开发者_运维知识库 my conception is bad (I am novice in Android dev.)...

Thank you very much for your help,

Fred


Android has ActivityGroup for the same purpose that you are looking for. By using ActivityGroup you can show multiple views in a single Tab by maintaining the stack of the Views.

ActivityGroup Example 1

ActivityGroup Example 2

Fragment - Answer to me by hackbod

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜