Search in sources :

Example 6 with Alarm

use of de.geeksfactory.opacclient.reminder.Alarm in project opacclient by opacapp.

the class AccountDataSource method getAlarmByDeadline.

public Alarm getAlarmByDeadline(LocalDate deadline) {
    String[] selA = { deadline.toString() };
    Cursor cursor = database.query(AccountDatabase.TABLENAME_ALARMS, AccountDatabase.COLUMNS_ALARMS, "deadline = ?", selA, null, null, null);
    Alarm item = null;
    cursor.moveToFirst();
    if (!cursor.isAfterLast()) {
        item = cursorToAlarm(cursor);
        cursor.moveToNext();
    }
    // Make sure to close the cursor
    cursor.close();
    return item;
}
Also used : Alarm(de.geeksfactory.opacclient.reminder.Alarm) Cursor(android.database.Cursor)

Aggregations

Alarm (de.geeksfactory.opacclient.reminder.Alarm)6 Cursor (android.database.Cursor)3 AccountDataSource (de.geeksfactory.opacclient.storage.AccountDataSource)2 DataIntegrityException (de.geeksfactory.opacclient.storage.DataIntegrityException)2 ArrayList (java.util.ArrayList)2 SuppressLint (android.annotation.SuppressLint)1 NotificationManager (android.app.NotificationManager)1 PendingIntent (android.app.PendingIntent)1 Intent (android.content.Intent)1 IntentFilter (android.content.IntentFilter)1 MalformedMimeTypeException (android.content.IntentFilter.MalformedMimeTypeException)1 Handler (android.os.Handler)1 OpacClient (de.geeksfactory.opacclient.OpacClient)1 Account (de.geeksfactory.opacclient.objects.Account)1 LentItem (de.geeksfactory.opacclient.objects.LentItem)1 ReminderHelper (de.geeksfactory.opacclient.reminder.ReminderHelper)1 List (java.util.List)1 DateTime (org.joda.time.DateTime)1 LocalDate (org.joda.time.LocalDate)1