Created
June 8, 2012 08:35
-
-
Save STAR-ZERO/2894491 to your computer and use it in GitHub Desktop.
【Android】SQLiteのCursorをデバッグ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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