public void onClickAddTitle(View view) { //---add a book--- ContentValues values = new ContentValues(); values.put("title", ((EditText) findViewById(R.id.txtTitle)).getText().toString()); values.put("isbn", ((EditText) findViewById(R.id.txtISBN)).getText().toString()); Uri uri = getContentResolver().insert( Uri.parse( "content://hr.math.provider.contprov/books"), values); } public void onClickRetrieveTitles(View view) { //---retrieve the titles--- Uri allTitles = Uri.parse( "content://hr.math.provider.contprov/books"); Cursor c; if (android.os.Build.VERSION.SDK_INT <11) { //---before Honeycomb--- c = managedQuery(allTitles, null, null, null, "title desc"); } else { //---Honeycomb and later--- CursorLoader cursorLoader = new CursorLoader( this, allTitles, null, null, null, "title desc"); c = cursorLoader.loadInBackground(); } if (c.moveToFirst()) { do{ Toast.makeText(this, c.getString(c.getColumnIndex( BooksProvider._ID)) + ", " + c.getString(c.getColumnIndex( BooksProvider.TITLE)) + ", " + c.getString(c.getColumnIndex( BooksProvider.ISBN)), Toast.LENGTH_SHORT).show(); } while (c.moveToNext()); } }