I'm following this tutorial and I need to add recycleview. But Android Studio cannot resolve RecyclerView. I added dependency to the gradle file as well. And I tried to add library to lib folder as stated here . But nothing works.
compile 'com.android.support:recyclerview-v7:23.2.0'
Here is the gradle code part.
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
)的定义。
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.