From 50bd7c7a059d8b116b31c0dc0bdf5d4e4b814a4f Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Tue, 13 Aug 2013 12:30:39 +0300 Subject: [PATCH] Fix previous commit --- src/ro/ieval/unical/Application.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/ro/ieval/unical/Application.java b/src/ro/ieval/unical/Application.java index 265de0d..09f8707 100644 --- a/src/ro/ieval/unical/Application.java +++ b/src/ro/ieval/unical/Application.java @@ -9,10 +9,11 @@ public final class Application extends android.app.Application { public void onCreate(){ alarmOpenHelper = new AlarmOpenHelper(this); final Cursor cur = alarmOpenHelper.getReadableDatabase().query(AlarmOpenHelper.TABLE, null, null, null, null, null, null); - cur.moveToFirst(); - do { - Utils.setAlarm(this, cur.getLong(0), cur.getLong(1)); - cur.moveToNext(); - } while(!cur.isAfterLast()); + if(cur.moveToFirst()) { + do { + Utils.setAlarm(this, cur.getLong(0), cur.getLong(1)); + cur.moveToNext(); + } while(!cur.isAfterLast()); + } } } -- 2.39.2