title: How to get all events from SQlite database in Alamkanak Android-Week-View library ? (i keep getting single Event)?
body: <p>I am trying to add  events dynamically from the my SQLite database , but i get a single event in my Week-view which it is the last event i add in the database , i am using Alamkanak Week-View , i stuck with problem and try many ways , please help guys .</p>
  
  <pre><code>mWeekView.setMonthChangeListener(new MonthLoader.MonthChangeListener() {
          @Override
          public List&lt;? extends WeekViewEvent&gt; onMonthChange(int newYear, int newMonth) {
              ArrayList&lt;WeekViewEvent&gt; lastevents = new ArrayList&lt;WeekViewEvent&gt;();
              lastevents = loadDateFromJson(newYear,newMonth);
                 events.addAll(loadDateFromJson(newYear,newMonth));
                  return events;
          }
      } );
  }
  
   public ArrayList&lt;WeekViewEvent&gt; getmNewEvents(int year , int month ) {
      // Parse time.
      SimpleDateFormat sdf = new SimpleDateFormat("HH:MM");
      Date start = new Date();
      Date end = new Date();
      start = getMyTime();
      try {
          end = sdf.parse(new Event().getEndTime());
      } catch (ParseException e) {
          e.printStackTrace();
      }
      Calendar now = Calendar.getInstance();
      Calendar startTime = (Calendar) now.clone();
      startTime.setTimeInMillis(start.getTime());
      startTime.set(Calendar.YEAR, now.get(Calendar.YEAR));
      startTime.set(Calendar.MONTH, now.get(Calendar.MONTH));
      startTime.set(Calendar.DAY_OF_MONTH, getMyDate());
      Calendar endTime = (Calendar) startTime.clone();
      endTime.add(Calendar.HOUR_OF_DAY, 3);
  </code></pre>
  
  <p>// Create an week view event.</p>
  
  <pre><code>    ArrayList&lt;WeekViewEvent&gt; ThisMonthsEvents = new   ArrayList&lt;WeekViewEvent&gt;();
      WeekViewEvent weekViewEvent =new WeekViewEvent(1,"Raouf",startTime,endTime);
      mNewEvents.add(weekViewEvent);
  
  for (int i = 0; i &lt; mNewEvents.size(); i++) {
          mNewEvents.get(i).getStartTime().get(Calendar.MONTH);
          if((mNewEvents.get(i).getStartTime().get(Calendar.MONTH) == month)&amp;&amp;(mNewEvents.get(i).getStartTime().get(Calendar.YEAR) == year))
              ThisMonthsEvents.add(mNewEvents.get(i));
  }
  ArrayList&lt;WeekViewEvent&gt; matchedEvents = new ArrayList&lt;WeekViewEvent&gt;();
          for (WeekViewEvent event : mNewEvents) {
              if (eventMatches(event, year, month)) {
                  matchedEvents.add(event);
              }
          }
          mWeekView.notifyDatasetChanged();
      return ThisMonthsEvents;
  }
  </code></pre>
  
  <p>// here how i am getting dates from my SQlite Database </p>
  
  <pre><code>public int getMyDate() {
      DBconexion db = new DBconexion(this);
      SQLiteDatabase db2 = db.getReadableDatabase();
      Cursor cur = db2.rawQuery("SELECT * FROM " + Table_name, null);
      SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd-mm-yyyy");
      // looping through all rows and adding to list
      String date = null;
      Date Date = new Date();
      ArrayList&lt;String&gt; dateStringList = new ArrayList&lt;String&gt;();
      ArrayList&lt;Date&gt; dateList = new ArrayList&lt;Date&gt;();
      int DayOfMonth = 0;
      while (cur.moveToNext()) {
          dateStringList.add(cur.getString(9));
      }
          for (String dateString : dateStringList) {
              try {
                  dateList.add(simpleDateFormat.parse(dateString));
              } catch (ParseException e) {
                  e.printStackTrace();
              }
          }
  
          for (Date datee : dateList) {
              DayOfMonth = datee.getDate();
          }
  
      return DayOfMonth;
  }
  </code></pre>