4

My first question I'd like to ask is that is it so that Fragment is only supported by android 3.0 ? If I am developing Android 2.1 application, can I use Fragment?

My second question is, I am implementing this simple feature, Fragment is a good choice, but I am developing Android 2.1 application, if the answer of my first question is negative, what could be the workaround to implement the feature I need?

Community
  • 1
  • 1
Mellon
  • 37,586
  • 78
  • 186
  • 264

2 Answers2

6

Yes you can use Fragment with Android 1.6 and later. See this post on the Android blog: Fragments For All

xevincent
  • 3,674
  • 18
  • 20
  • @ xevincent , after I install the component through Eclipse "Android SDK and AVD manager" do I need to do something else or I can already use the Fragment directly? in @ AshtonBRSC suggested link, seems I have to create a lib directory and configure something (See "Setting Up a Project to Use the Library") http://developer.android.com/sdk/compatibility-library.html – Mellon Jul 13 '11 at 10:04
  • 2
    Follow the steps in http://developer.android.com/sdk/compatibility-library.html. You have to include the jar in your project. – xevincent Jul 13 '11 at 10:10
1

You need to use the Fragments Compatability Library that works with Android 1.6 and above:

http://developer.android.com/sdk/compatibility-library.html

Intrications
  • 16,782
  • 9
  • 50
  • 50