To introduce. Pulltorefresh as an example
- Download zip, unzip to desktop
- Open eclipse,file-import-existing Android Code into Workspace
- Select the library file to import into eclipse
- Open this library, right-click library,properties-android-library-check is Library
- After opening your program, right-click your main program, Properties-android-library-add, select Library file
The basic steps for importing are like this, and the next step is how to use
- Find your program-layout-xml add a
<com.handmark.pulltorefresh.library.pulltorefreshlistview
Android:id= "@+id/pull_to_refresh_listview"
Android:layout_width= "Fill_parent"
android:layout_height= "Fill_parent"/>
- Back to Mainactivity, add a piece of code to the header file
Import Com.handmark.pulltorefresh.library.PullToRefreshListView;
- Then change all the ListView you need to Pulltorefreshlistview, for example
Private Pulltorefreshlistview Mpullrefreshlistview;
- Then use it like a ListView.
......................................................................................................................... .............................................
However, after introduction, it is possible to introduce failure, the green check mark becomes the red difference, the reason may be as follows:
Library and project under different drive letter, due to the disk character under Windows support problem, can not drink different drive under the library, the library in the same directory with project can be resolved
How Android introduces open source projects