Cursor cursor = null; PreparedQuery preparedQuery = null; SQLiteDatabase db = MainActivity.getDatabase(context); if (db != null) { try { RuntimeExceptionDao dao; dao = RuntimeExceptionDao.createDao(new AndroidConnectionSource(db), Inspection.class); preparedQuery = dao.queryBuilder().prepare(); AndroidDatabaseResults results = (AndroidDatabaseResults) dao.iterator(preparedQuery).getRawResults(); cursor = results.getRawCursor(); recyclerView.setAdapter(new MyInspectionRecyclerViewAdapter(cursor, preparedQuery, mListener)); } catch (SQLException e) { e.printStackTrace(); } catch (IllegalStateException e) { e.printStackTrace(); } }