Returns an String representing the Column data of the Cursor. Cursor can be null which results in an empty string returned - Android Database

Android examples for Database:Cursor Column

Description

Returns an String representing the Column data of the Cursor. Cursor can be null which results in an empty string returned

Demo Code


//package com.java2s;
import android.database.Cursor;
import android.database.DatabaseUtils;

public class Main {
    /**//from   ww  w  .ja  v a2s.  c o m
     * Returns an String representing the Column data of the Cursor.</br>
     * Cursor can be null which results in an empty string returned
     *
     * @param cursor
     * @return
     */
    public static String logCursorColumnToString(final Cursor cursor) {
        if (cursor == null) {
            return "";
        }
        return DatabaseUtils.dumpCurrentRowToString(cursor);
    }
}

Related Tutorials