Dump Database cursor - Android Database

Android examples for Database:Cursor

Description

Dump Database cursor

Demo Code


//package com.java2s;
import android.database.Cursor;
import android.util.Log;

public class Main {

    public static void printCursor(Cursor cursor) {
        while (cursor.moveToNext()) {
            Log.i("CursorUtils", "--------------------");
            //?????
            for (int i = 0; i < cursor.getColumnCount(); i++) {
                Log.i("CursorUtils",
                        cursor.getColumnName(i) + ":" + cursor.getString(i));
            }//from   w w w .  j a  v  a 2  s  .  c o m
        }
    }
}

Related Tutorials