Action Bar Tabs without using Fragments?

10,373

Solution 1

If you're set on using Activities over Fragments you could just use an intent to launch your activity from your ActionBar.TabListener

startActivity(new Intent(thisActivity(), thatActivity.class)); 

You should also check out this comment about using Fragments over Activities

Solution 2

Is there a possibility to use activities within the action bar tabs anyway?

Fortunately, no.

That does not mean you have to use fragments, though. Your TabListener can do whatever it wants to affect the change in your UI. A brute-force solution would be to call setContentView() again, to dump all your old widgets and lay down a brand-new (presumably different) set.

Share:
10,373
Maddin
Author by

Maddin

Updated on June 25, 2022

Comments

  • Maddin
    Maddin almost 2 years

    It is maybe quite a newbie question but anyway. Since Tabhost is depreciated I tried to switch to the action bar tabs but I have my problems using fragments. Is there a possibility to use activities within the action bar tabs anyway?

    I would appreciate any help.

    Thanks.