Java tutorial
//package com.java2s; //License from project: Apache License import android.database.Cursor; public class Main { /** * Checks if it is a valid column within the cursor data * * @param cursor * @param columnName * @return */ private static boolean isValidColumn(Cursor cursor, String columnName) { int x = cursor.getColumnIndex(columnName); if (x < 0) { //No column matches that, it doesn't exist return false; } else { //A column matches that, it exists return true; } } }