SimpleCursorAdapter is an indirect subclass of CursorAdapter as stated in the Android documentation. But
CursorAdapter cursorAdapter = new SimpleCursorAdapter(bla, bla, bla);
yields error from the compiler:
Type mismatch: cannot convert from SimpleCursorAdapter to CursorAdapter
Yet this has no errors:
abstract class A {
}
class B extends A {
}
class C extends B {
}
public class Main {
/**
* @param args
*/
public static void main(String[] args) {
A c = new C();
}
}
Is the documentation simply wrong, or am I missing something?
Thanks for your time.
My guess is that you’ve got another type called
SimpleCursorAdapterorCursorAdaptersomewhere – check your import statements. You should be importingandroid.widget.SimpleCursorAdapterandandroid.widget.CursorAdapter.