-2

please can someone assist I am trying to retrieve a list of contacts from the phone on Android. The only issue that I have in public Loader onCreateLoader the new Cursor gives me an error. The error is ? android.support.v4.content.CursorLoader?(Multiple choices..).

public class Contacts extends AppCompatActivity implements
LoaderManager.LoaderCallbacks<Cursor>
//AdapterView.OnItemClickListener
{
    ...
    @Override
    public Loader<Cursor> onCreateLoader(int loaderId, Bundle args) {

        //Starts the query
        return new CursorLoader(
            getApplicationContext(),
            ContactsContract.Contacts.CONTENT_URI,
            PROJECTION,
            SELECTION,
            mSelectionArgs,
            null
        );
    }
}

Removed all unnecessary bits to make it a bit clearer.

the_big_blackbox
  • 1,056
  • 2
  • 15
  • 35

1 Answers1

0

import android.support.v4.content.CursorLoader - did the trick

the_big_blackbox
  • 1,056
  • 2
  • 15
  • 35