Java tutorial
//package com.java2s; import android.database.Cursor; public class Main { /** * Retrieves a {@link String} value from the {@link Cursor}. * * @param cursor * The {@link Cursor} pointing at the correct record. * @param strColName * The name of the column to retrieve. * @return A {@link String} containing the value. */ public static String getString(final Cursor cursor, final String strColName) { String strResult = cursor.getString(cursor.getColumnIndex(strColName)); if (strResult == null) strResult = ""; return strResult; } }