Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android, Type argument listadapter

so i'm following a guide online to make a room db. In the adapter section i followed his way of doing it but when i did it, i keep having the "No Type Argument expected for Interface ListAdapter".

Error example: https://imgur.com/kPT7DkE

Here's the whole project so far on github.

https://github.com/OlivierLabelle/BudgetProject/tree/master/app/src/main/java/com/example/android/budgetproject

And the guide i was following.

https://medium.com/@trionkidnapper/recyclerview-more-animations-with-less-code-using-support-library-listadapter-62e65126acdb

like image 594
Olivier labelle Avatar asked Apr 02 '18 19:04

Olivier labelle


2 Answers

So with the help of devboi, i found out i was using the wrong import.

In the top right corner on the Dev documentation it show the right import.

https://imgur.com/vGrCOVd

And here how the import on my project should look like.

import android.support.v7.recyclerview.extensions.ListAdapter
like image 73
Olivier labelle Avatar answered Sep 27 '22 19:09

Olivier labelle


Just came across this very problem myself.

If you're using AndroidX/Jetpack/whatever the official name is I'm still new at this, Android Studio might
import android.widget.ListAdapter
automatically, but the one you want is
import androidx.recyclerview.widget.ListAdapter

like image 32
Slashee the Cow Avatar answered Sep 27 '22 18:09

Slashee the Cow