How to import RecyclerView for Android L-preview

前端 未结 22 1544
被撕碎了的回忆
被撕碎了的回忆 2020-12-02 14:55

Trying to use the new RecyclerView from the support library. I downloaded the 20 update for the support library using the SDK manager.

I\'ve added the jar file to th

22条回答
  •  有刺的猬
    2020-12-02 15:37

    Figured it out.

    You'll have to add the following gradle dependency :

    compile 'com.android.support:recyclerview-v7:+'
    

    another issue I had compiling was the compileSdkVersion. Apparently you'll have to compile it against android-L

    Your build.gradle file should look something like this:

    apply plugin: 'android'
    android {
        compileSdkVersion 'android-L'
        buildToolsVersion '19.1.0'
        [...]
    }
    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        compile 'com.android.support:recyclerview-v7:+'
    }
    

提交回复
热议问题