Print the cursor to the logcat row by row you can use code as below:
Cursor cursor = mContext.getContentResolver().query(mUri, mProjections, null, null, null); if (cursor.moveToFirst()) { do { StringBuilder sb = new StringBuilder(); int columnsQty = cursor.getColumnCount(); for (int idx = 0; idx < columnsQty; ++idx) { sb.append(cursor.getString(idx)); if (idx < columnsQty - 1) sb.append("; "); } Log.v(TAG, String.format("Row: %d, Values: %s", cursor.getPosition(), sb.toString())); } while (cursor.moveToNext()); }
No comments:
Post a Comment