简体   繁体   English

Android Studio无法识别方法?

[英]Android studio not recognizing a method?

I'm trying to use the method findFirstVisibleItemPosition() from a LinearLayoutManager . 我正在尝试使用LinearLayoutManager的方法findFirstVisibleItemPosition() The apis show that this method exists, but it is not recognized nor shown in autocompletion. api显示此方法存在,但无法自动完成也无法识别。

Other methods from this layout work (some at least), and android.support.v7.widget.LinearLayoutManager is imported. 此布局中的其他方法(至少有些可行)起作用,并且android.support.v7.widget.LinearLayoutManager已导入。

What could be wrong? 有什么事吗

edit: here´s my build.gradle: 编辑:这是我的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'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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