I haven’t been working with android 3.0+, nor the action bar, so I have a question about the tabs that can be implemented in the action bar. Is it only restricted to changing fragments? Can the tabs be: the first an activity, the second fragment? From the examples I checked out, there is one main activity that has an action bar and the content of each tab is a separate fragment.. Sorry if my question is something obvious. Thank u in advance.
Share
I dont see the advantage of you using an Activity as the first over using Fragments for them all? Fragments are very powerful and can provide just as much as an Activity.
Having said that, you should be able to get a callback when a Tab is selected, and so in that callback all you have to do is load up an Activity. Make sure you pass in the currently selected tab when you load up the new Activity so that the user can see which one the had selected.
The reasoning behind using a Fragment instead is that you will not have to load up a new Activity, and you can replace the current Fragment with your new Content.