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 float getCursorFloat(Cursor cursor, String name) {
        if (isCursorEmpty(cursor)) {
            return 0;
        } else {
            return cursor.getFloat(cursor.getColumnIndex(name));
        }
    }

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