How to import RecyclerView for Android L-preview

前端 未结 22 1614
被撕碎了的回忆
被撕碎了的回忆 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:31

    My dependencies;

    dependencies {
        compile fileTree(include: ['*.jar'], dir: 'libs')
        compile 'com.android.support:appcompat-v7:25.1.0'
    
        //RecyclerView dependency
        compile 'com.android.support:recyclerview-v7:25.1.0'
    
        // Instrumentation dependencies use androidTestCompile
        // (as opposed to testCompile for local unit tests run in the JVM)
        androidTestCompile 'junit:junit:4.12'
        androidTestCompile 'com.android.support:support-annotations:25.1.0'
        androidTestCompile 'com.android.support.test:runner:0.5'
        androidTestCompile 'com.android.support.test:rules:0.5'
    }
    

    I added only compile 'com.android.support:recyclerview-v7:25.1.0'. The important thing is to add RecycleView dependency which is as the same version as appcompat

提交回复
热议问题