Toolbar along with TabHost

0

Hello. I created two tabs in my application. Order Open and Order Closed. But in this activity Toolbar does not catch.

Code:

publicclassPedidoActivityextendsActivity{/**Calledwhentheactivityisfirstcreated.*/@OverridepublicvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);setContentView(R.layout.activity_pedido);TabHosttabHost=(TabHost)findViewById(R.id.tabHost);tabHost.setup();TabSpecspec1=tabHost.newTabSpec("EM ABERTO");
    spec1.setContent(R.id.tab1);
    spec1.setIndicator("EM ABERTO" ,getResources().getDrawable(R.drawable.ic_menu_camera));

    TabSpec spec2=tabHost.newTabSpec("FECHADO");
    spec2.setIndicator("FECHADO" ,getResources().getDrawable(R.drawable.ic_menu_camera));
    spec2.setContent(R.id.tab2);


    tabHost.addTab(spec1);
    tabHost.addTab(spec2);


}

This screen does not look like the others, for example:

I'd like to add a toolbar on this screen as well. Because in this toolbar I want to add the back button.

    
asked by anonymous 31.05.2016 / 00:18

1 answer

0

I would like to be able to comment, because the answer would be short, but I can not because I do not have enough repo.

My county and you create a TabbedActivity with Action Bar Tabs this activity has a ViewPager and a toolbar .

I think it would make things much easier for you, some doubt says!

Good work

    
31.05.2016 / 12:41