Android examples for Database:Cursor Column
Return the long stored in the specified column of the cursor, -1 if column does not exist
import java.io.Closeable; import java.io.IOException; import android.database.Cursor; public class Main{ /** Return the long stored in the specified column of the cursor, -1 if column does not exist */ public static long getLong(Cursor cursor, DatabaseColumn column) { int index = cursor.getColumnIndex(column.getName()); return (index != -1) ? cursor.getLong(index) : index; }// ww w.j a v a 2s . co m }