Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.database.Cursor;

public class Main {
    public static int getCursorInt(Cursor cursor, String name) {
        if (isCursorEmpty(cursor)) {
            return 0;
        } else {
            return cursor.getInt(cursor.getColumnIndex(name));
        }
    }

    public static boolean isCursorEmpty(Cursor cursor) {
        return (cursor == null || cursor.isClosed() || cursor.getCount() == 0);
    }
}