From: Marius Gavrilescu Date: Tue, 13 Aug 2013 09:30:39 +0000 (+0300) Subject: Fix previous commit X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=50bd7c7a059d8b116b31c0dc0bdf5d4e4b814a4f;p=unical.git Fix previous commit --- 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()); + } } }