Add Android Support Package

I have a old post "Install and setup Compatibility Package" describe how to include Android Support Package in Java Build Path. I try again it recently, it seem that the method no longer work! When work with android.support.v4.app.FragmentActivity, java.lang.ClassNotFoundException will be thrown.

It can be solved by Add Support Library in Eclipse menu.
- New a Android project target Android 3.0 (API Level 11).

- Modify AndroidManifest.xml to specify minSdkVersion and targetSdkVersion:
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="11"/>

- Add Android Support Library.
Right click on the project in Eclipse, select Android Tools, Add Support Library...

Add Support Library...


Accept to install Android Support.

install Android Support Package


- Test it
Modify your activity extends FragmentActivity instead Activity, and import android.support.v4.app.FragmentActivity.

Now you can run it without error.

thumbnail
Title: Add Android Support Package
Rating: 100% based on 99998 ratings. 10 user reviews.
Post by

Related articles :

0 comments:

Post a Comment

My Blog List

 
Copyright © 2015. About - Web Version - Mobile Version Sitemap - Contact - Privacy