Cannot extend ListFragment - "API level 11 is required to call"

I am trying to extend a ListFragment, but I keep getting the error above. I added the Android support library to my project.

+4
source share
2 answers

You probably have the wrong import of your project / class. You are probably extending ListFragment from API 11 (android.app.ListFragment) and you should extend ListFragment from compatibility class ( android.support.v4.app.ListFragment )

+19
source

Try to add

 import android.support.v4.app.Fragment; import android.support.v4.app.ListFragment; 
+7
source

All Articles