+ public static Long[] getAlarmsByEvent(final Application application, final long eventId) throws SQLException{
+ final SQLiteDatabase db = application.alarmOpenHelper.getWritableDatabase();
+ db.delete(AlarmOpenHelper.TABLE, AlarmOpenHelper.TIME + " < " + System.currentTimeMillis(), new String[0]);
+ final Cursor cursor = db.query(AlarmOpenHelper.TABLE, new String[]{AlarmOpenHelper.TIME}, AlarmOpenHelper.EVENT + " = " + eventId, new String[0], null, null, null);
+ if(cursor.moveToFirst()){
+ final Long[] ret = new Long[cursor.getCount()];
+ for(int i=0;i<ret.length;i++){
+ ret[i]=cursor.getLong(0);
+ cursor.moveToNext();
+ }
+ return ret;
+ }
+ return new Long[0];
+ }
+