Pawel B Pawel B - 1 month ago 21
Android Question

extends RecyclerView.Adapter not available

trying extend my class with "extends RecycleView.Adapter" but it seams like it is not "available" , I Rebuilded and cleaned up the project but it's no help.
build.cradle : (in case that have anything to do with it)

minSdkVersion 15
targetSdkVersion 23
compileSdkVersion 23
buildToolsVersion "23.0.1"


(thank U for any help)

Answer

You have to import its library as follows :

compile 'com.android.support:recyclerview-v7:23.0.1'

Example :

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:recyclerview-v7:23.0.1'
}

Make sure that you are importing import android.support.v7.widget.RecyclerView;

Your class should look like this :

public class MyRecyclerViewAdapter extends RecyclerView.Adapter<MyRecyclerViewAdapter.CustomViewHolder> {