Getting Events from Calendar Provider Android -


i make simple method events calendar provider. events facebook calendar , holidays calendar. why it's not working other calendars google calendar?

public list<eventdata> geteventsfromday(calendar begintime, calendar endtime) {     //convert callendar data millis     long beginmillis = begintime.gettimeinmillis();     long endmillis = endtime.gettimeinmillis();     //list of events day     list<eventdata> allevents = new arraylist<>();      ///////////searching events id day instances table      //what want data     string[] instancequery =             new string[]{                     instances._id,                     instances.begin,                     instances.end,                     instances.event_id};      //cursor needed data     cursor cursor =             instances.query(mcontext.getcontentresolver(), instancequery, beginmillis, endmillis);      if (cursor.movetofirst()) {         {             //save id of every event day             eventdata singleevent = new eventdata();             singleevent.setid(cursor.getlong(3));             allevents.add(singleevent);         } while (cursor.movetonext());     }     //always close cursor!!     cursor.close();      ////////// searching details of events events table      //what want data     string[] eventquery =             new string[]{                     events._id,                     events.title,                     events.event_color,             };       (int = 0; < allevents.size(); i++) {      //cursor needed data     cursor eventcursor =             mcontext.getcontentresolver().                     query(                             events.content_uri,                             eventquery,                             events._id + " = ? ",                             new string[] {long.tostring(allevents.get(i).getid())},                             null);     //convert data cursor     if (eventcursor.movetofirst()) {             allevents.get(eventcursor.getposition()).settitle(eventcursor.getstring(1));             allevents.get(eventcursor.getposition()).setcolor(eventcursor.getstring(2));     }         //always close cursor!!         eventcursor.close();     }      return allevents;  } 

the whole aplication here: https://github.com/mulciber55/wombatcalendar


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -