Reputation: 49
Which is the best way to develop an Android application with tabs. I have read many web sites but I have not found a way that convinces me.
I want to develop an app which runs in all APIs.
I want to make an app like Contacts App (Phone, Call log, Contacts, Favourites, etc). I need 3 tabs and in each tab I want a ListView. When you press an item of the ListView I want to show a second ListView depending on the item pressed.
I have an App which do that, but I don't know how can I do with tabs.
Thanks
Upvotes: 0
Views: 79
Reputation: 1006554
ActionBar: doesn't work in API 10 and previous.
ActionBarSherlock offers a backport of the action bar to API Level 7. However, sometimes its tabs get converted into a drop-down navigation instead.
TabActivity: is deprecated.
You can still use TabHost
and TabWidget
from a regular Activity
, as is shown in this sample project. However, TabHost
looks dated from a UI aesthetics standpoint.
Fragments: I don't understand.
Since they have been around for nearly 2.5 years, you might consider learning how to use them.
I want to make an app like Contacts App (Phone, Call log, Contacts, Favourites, etc).
The Contacts app uses a ViewPager
, with fragments as the pages. You do not have to use fragments for pages in a ViewPager
, though it does tend to make things a bit easier IMHO.
Upvotes: 5