hermann
hermann

Reputation: 6295

Android > 4.0 Fragments and Tabs

I am really lost here.

I want to make an app that will have tabs ( fragments? ). So whenever a user clicks on a tab, a new fragment is loaded.

The UI would be similar to the one under View Control -> Fixed Tabs here : http://developer.android.com/design/patterns/actionbar.html

I don't need backward compatibility.

I have no idea how to proceed as I am really confused. Any pointers would be greatly appreciated.

Thank you.

Upvotes: 3

Views: 5136

Answers (2)

Gunnar Karlsson
Gunnar Karlsson

Reputation: 28470

You can quite easily create a sample app with Fragments linked to Tabs in Eclipse:

  • File > New > Android Application
  • Choose Min SDK API 14, targetSDK API 17. Click Next. Click Next again.
  • Create your icon. Click Next.
  • Tick Create Activity. Choose Blank Activity. Click Next.
  • Click Navigation Type. Choose Tabs, or Tabs + Swipe, or whichever option you want. Click Finish.
  • You're done. You have a fully functioning sample app with source for Fragments and Tabs.

Upvotes: 2

Ahmad
Ahmad

Reputation: 72533

You can download a nice tab navigation example on developer.android.com. If you don't need backward compatibility then you don't have to modify it and can use it right away.

Upvotes: 1

Related Questions