I just tried your code and it worked without an issue.
You should double-check your imports. The SimpleCursorLoader you linked to is using the support library. You didn't provide the code, but I think you may be using the default LoaderManager, not the one provided by the support library.
So for you to be able to use this class you need to reference android.support.v4.content.Loader
and load it using the SupportLoaderManager
in your Fragment.
Here is the code from my Fragment that worked: (Note the use of the support library.)
import android.database.Cursor;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.LoaderManager.LoaderCallbacks;
import android.support.v4.content.Loader;
...
public class MainActivity extends FragmentActivity implements LoaderCallbacks<Cursor>{
...
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
this.getSupportLoaderManager().initLoader(0, null, this);
}
...
@Override
public Loader<Cursor> onCreateLoader(int arg0, Bundle arg1) {
return new ListCursorLoader(this);
}
...
}