Importing CardView and RecyclerView (Android 5.0) in my existing project (eclipse)

怎甘沉沦 提交于 2019-12-01 14:59:00

They are also available as Android library projects now, in extras/android/support/v7/ of your SDK installation. Make a copy of those projects elsewhere on your hard drive, import them into Eclipse, then reference them as libraries from your app following the instructions in the documentation.

Currently to get the recyclerView you first download from the sdk manager the Android support repository in the 'Extras" section. After that you need to import all the libraries from here (starting from your sdk folder path):

sdk\extras\android\m2repository\com\android\support

adding android-support-v7-recyclerview.jarfrom the folder: sdk\extras\android\support\v7\recyclerview\libs to the libs resolved my problem.

For RecyclerView i am able to run by simply adding the jar file of recycler obtained from the libs folder of recycler within v7 support folder for cardview , i imported it as a android project , made it as a library and added to my project. the UI in my android worked perfect for first run but now it shows error in the UI editor but runs perfectly in emulator. hope it helps

Finally, i resolved my problem.

.../sdk/extras/android/support/v7/

>appcompat
    >libs
        >android-support-v4.jar
        >android-support-v7-appcompat.jar
>cardview
    >libs
        >android-support-v7-cardview.jar
>gridlayout
    >libs
        >android-support-v7-gridlayout.jar
>mediarouter
    >libs
        >android-support-v7-mediarouter.jar
>palette
    >libs
        >android-support-v7-palette.jar
>recyclerview
    >libs
        >android-support-v7-recyclerview.jar

copy all jar file above to your project libs, and use this android-support-v4.jar above instead of yours

thaitujim

add appcompat-v7.jar to your libs. This problem will be resolved.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!