简体   繁体   中英

Android studio not recognizing a method?

I'm trying to use the method findFirstVisibleItemPosition() from a LinearLayoutManager . The apis show that this method exists, but it is not recognized nor shown in autocompletion.

Other methods from this layout work (some at least), and android.support.v7.widget.LinearLayoutManager is imported.

What could be wrong?

edit: here´s my build.gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion "21.1.2"

    defaultConfig {
        applicationId "com.example.skate.socialskate"
        minSdkVersion 21
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])

    compile 'com.google.android.gms:play-services:7.0.0'
    compile 'com.android.support:cardview-v7:22.1.0'
    compile 'com.android.support:recyclerview-v7:21.0.+'
    compile 'com.android.support:support-v13:22.1.0'
    compile 'de.hdodenhof:circleimageview:1.2.1'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'org.codehaus.jackson:jackson-mapper-asl:1.9.13'
    compile 'org.jsoup:jsoup:1.8.2'

}

您需要将一个appcompat添加到build.gradle

compile 'com.android.support:appcompat-v7:22.1.1'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM