Android examples for Database:Cursor Get
get Cursor Integer Value
//package com.java2s; import android.database.Cursor; public class Main { public static int getCursorIntegerValue(String ColumnName, Cursor cursor) { int col = cursor.getColumnIndex(ColumnName); if (col != -1 && !cursor.isNull(col)) { return cursor.getInt(col); } else {/*from w w w .j av a2s . c o m*/ return -1; } } }