如何在项目中包含pulltorefresh库?
问题描述:
我有麻烦,包括我的android项目中的PullToRefresh库。它作为Github上的源代码形式发布,我已经将它作为Eclipse中的单独项目导入。 File
- >Import Existing Code Into Workspace
。编译它,然后将其添加到我的项目的构建路径。 (Project
- >Properties
- >Java Build Path
- >Project Tab
。问题是,它没有被编译到apk中的dex文件中。我用dex2jar来验证问题是否存在。 ?如何在项目中包含pulltorefresh库?
UPDATE:看来,R.class在库.jar文件不被benerated任何人都知道为什么,可能是这种情况
答
它可能是库项目 办?以下 1)您需要下载完整的文件夹(https://github.com/johannilsson/android-pulltorefresh/tree/master/pulltorefresh)
2)导入到Eclipse作为一个项目(文件>导入>现有的Android代码)
3)在您的应用程序,右击>属性>安卓(下左侧窗格中)>添加库(右下图)
4)选择库,它应该工作
你为什么不想要使用的https://developer.android.com/reference/android/support/v4/widget/SwipeRefreshLayout。 html? – ligi 2014-10-31 15:02:30
想,但我需要使用这个,不要问为什么 – Nederealm 2014-10-31 15:03:11
如果你有它作为一个图书馆项目与你自己,你需要去项目 - > porperties-> android(在你自己的项目),然后在底部你可以添加PullToRefresh,这里也解释:http://stackoverflow.com/questions/8248196/how-to-add-a-library-project-to-a-android-project – cYrixmorten 2014-10-31 15:22:27