我最近升级到AndroidStudio2.3,没有找到getAdapterPosition (RecyclerView)。我在网上看到的原因是支持库版本。但我仍然不知道如何解决这个问题。我的支持:appcompat-v7:25.2.0‘版本是最新的可能(例如,上面的21)。我不明白为什么找不到这个方法。有什么建议吗?
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile files('libs/wekaSTRIPPED.jar')
compile('com.mikepenz:materialdrawer:5.8.1@aar') { // Material Drawer
transitive = true
}
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.jakewharton:butterknife:8.5.1'
compile 'com.google.dagger:dagger:2.9'
compile 'com.github.wendykierp:JTransforms:3.1'
compile 'com.afollestad.material-dialogs:commons:0.9.3.0'
compile 'org.greenrobot:eventbus:3.0.0'
compile 'com.github.paolorotolo:appintro:4.1.0'
compile 'com.android.support:support-v4:25.2.0'
compile 'com.android.support:design:25.2.0'
compile 'com.borax12.materialdaterangepicker:library:1.9'
compile 'com.evernote:android-job:1.1.7' // Scheduling library
testCompile 'junit:junit:4.12'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
annotationProcessor 'com.google.dagger:dagger-compiler:2.9'发布于 2017-03-08 09:06:47
请您检查一下您是否在ViewHolder类中使用此方法?
getAdapterPostion()是RecyclerView.ViewHolder.的方法
您需要确保在扩展RecyclerView.ViewHolder的类中使用此方法。
发布于 2017-03-08 08:42:12
compile 'com.android.support:recyclerview-v7:25.2.0' 可能漏掉了那条线?
发布于 2017-03-08 08:41:16
请添加此依赖项:编译‘com.android.Support:recyclerview v7:23.3.0’
https://stackoverflow.com/questions/42666518
复制相似问题