public ArrayList<Market> getMarkets() {
   ArrayList<Market> markets = new ArrayList<Market>();
   SQLiteDatabase dataBase = dbHelper.getReadableDatabase();
   Cursor cursor =
       dataBase.query(Market.MarketEntry.TABLE_NAME, null, null, null, null, null, null);
   if (cursor.moveToFirst()) {
     while (cursor.isAfterLast() == false) {
       Market market = new Market();
       market.setIdMarket(cursor.getInt(Market.MarketEntry.INDEX_ENTRY_ID));
       market.setName(cursor.getString(Market.MarketEntry.INDEX_NAME));
       market.setLatitude(Double.valueOf(cursor.getString(Market.MarketEntry.INDEX_LATITUDE)));
       market.setLongitude(Double.valueOf(cursor.getString(Market.MarketEntry.INDEX_LONGITUDE)));
       market.setAddress(cursor.getString(Market.MarketEntry.INDEX_ADDRESS));
       markets.add(market);
       cursor.moveToNext();
     }
   }
   return markets;
 }
 public ArrayList<Reminder> getActiveReminders() {
   ArrayList<Reminder> reminders = new ArrayList<Reminder>();
   try {
     SQLiteDatabase dataBase = dbHelper.getReadableDatabase();
     Cursor cursor =
         dataBase.query(Reminder.ReminderEntry.TABLE_NAME, null, null, null, null, null, null);
     if (cursor.moveToFirst()) {
       while (cursor.isAfterLast() == false) {
         Reminder reminder = new Reminder();
         String date = cursor.getString(Reminder.ReminderEntry.INDEX_DATE);
         GregorianCalendar gregorianCalendar = DateUtils.parserStringDate(date);
         reminder.setDate(gregorianCalendar);
         GregorianCalendar currentDate = new GregorianCalendar();
         String state = cursor.getString(Reminder.ReminderEntry.INDEX_ESTADO);
         /*if(state.compareTo("RESOLVED") == 0 ||state.compareTo("resolved") == 0){
             continue;
         }*/
         if (gregorianCalendar.compareTo(currentDate) == 1) {
           reminder.setIdReminder(cursor.getInt(Reminder.ReminderEntry.INDEX_ENTRY_ID));
           reminder.setTitle(cursor.getString(Reminder.ReminderEntry.INDEX_TITLE));
           reminder.setNotes(cursor.getString(Reminder.ReminderEntry.INDEX_NOTES));
           reminder.setDaysAfter(cursor.getInt(Reminder.ReminderEntry.INDEX_DAYS_AFTER));
           reminder.setHourRange(cursor.getInt(Reminder.ReminderEntry.INDEX_HOUR_RANGE));
           String photoPath = cursor.getString(Reminder.ReminderEntry.INDEX_PHOTO_PATH);
           String voiceNotePath = cursor.getString(Reminder.ReminderEntry.INDEX_VOICE_NOTE_PATH);
           reminder.setPhotoPath(photoPath);
           reminder.setVoiceNotePath(voiceNotePath);
           reminder.defineDatesOfNotifications();
           reminders.add(reminder);
         }
         cursor.moveToNext();
       }
     }
   } catch (Exception e) {
     e.printStackTrace();
   }
   Collections.sort(reminders);
   // Collections.reverse(reminders);
   return reminders;
 }