Unable to use Fragments with Android Compatibility Package

后端 未结 6 1013
一个人的身影
一个人的身影 2020-12-08 14:53

In \"Fragments for All\", Xavier Ducrohet, Android SDK Tech Lead says Google releases an Android Compatibility Package by SDK Manager.

I\'ve installed it, but, how c

相关标签:
6条回答
  • 2020-12-08 15:03

    If you're using version 12 or later of the Eclipse Android support library, just right-click on your project, and choose Android Tools > Add Compatibility Library...

    0 讨论(0)
  • 2020-12-08 15:03

    Premier,

    I followed the Fragments example on the Android Developers Blog to create a "backwards" compatible app using Fragments. In the article there is a brief mention of the Main activity that uses a layout with fragments.

    The code for this activity is not interesting; it just calls setContentView() with the given layout:

    What should be mentioned here is that this activity must derive from FragmentActivity and not Activity class. This threw me off for a while.

    Good luck

    0 讨论(0)
  • 2020-12-08 15:10

    Refer Using Fragment of Android Compatibility Package may help you

    0 讨论(0)
  • 2020-12-08 15:15

    Check the "Step 2: Configuring the Build Path" Section here

    0 讨论(0)
  • 2020-12-08 15:23

    There is a .jar file called android-support-v4.jar in the directory {yoursdkpath}/extras/android/compatibility/v4/. Copy this into your libs folder in the root of your project and add the file to the build path in Eclipse.

    0 讨论(0)
  • 2020-12-08 15:30

    This is easy with new Eclipse I downloaded. Provided you have all the paths for SDK etc setup correctly, Right click on Project -> Android tools-> and Hit "Add compatibility Library" it will add the JAR file

    0 讨论(0)
提交回复
热议问题