get Cursor Boolean Value - Android Database

Android examples for Database:Cursor Get

Description

get Cursor Boolean Value

Demo Code


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

public class Main {

    public static boolean getCursorBooleanValue(String ColumnName,
            Cursor cursor) {// ww w.  j  av  a  2 s  .c o m
        int col = cursor.getColumnIndex(ColumnName);
        if (col != -1 && !cursor.isNull(col)) {
            return cursor.getInt(col) != 0;
        } else {
            return false;
        }
    }
}

Related Tutorials