Skip to content

Instantly share code, notes, and snippets.

@STAR-ZERO
Created June 8, 2012 08:35
Show Gist options
  • Save STAR-ZERO/2894491 to your computer and use it in GitHub Desktop.
Save STAR-ZERO/2894491 to your computer and use it in GitHub Desktop.
【Android】SQLiteのCursorをデバッグ
private void debugCursor(Cursor c) {
if (c.moveToFirst()) {
do {
StringBuffer sb = new StringBuffer();
sb.append("[");
for (int i = 0; i < c.getColumnCount(); i++) {
sb.append(c.getColumnName(i));
sb.append("=");
sb.append(c.getString(i));
sb.append(",");
}
sb.append("]");
Log.d(TAG, sb.toString());
} while (c.moveToNext());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment