[英]cannot resolve RecyclerView Adapter
I'm following this tutorial and I need to add recycleview.我正在关注本教程,我需要添加 recycleview。 But Android Studio cannot resolve RecyclerView.但是 Android Studio 无法解析 RecyclerView。 I added dependency to the gradle file as well.我也向 gradle 文件添加了依赖项。 And I tried to add library to lib folder as stated here .我尝试作为陈述库添加到lib文件夹这里。 But nothing works.但没有任何作用。
compile 'com.android.support:recyclerview-v7:23.2.0'
Here is the gradle code part.这是gradle代码部分。
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:design:23.2.0'
compile 'com.android.support:recyclerview-v7:23.2.0'
}
It fails in this line.它在这一行失败了。
RecyclerView.Adapter recyclerViewAdapter;
recyclerViewAdapter = new RecyclerViewAdapter(navTitles,navIcons,this);
recyclerView.setAdapter(recyclerViewAdapter);
您只需在教程中进一步阅读,其中包含RecyclerViewAdapter
类(扩展RecyclerView.Adapter
)的定义。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.