android - How can I get long value of event Id from Event object? -


i using google calendar api events. after got events,the event object doesn't contain long value of event id. want use event id view event details via google calendar app.

can tell me how that?

  compile('com.google.apis:google-api-services-calendar:v3-rev125-1.20.0') {     exclude group: 'org.apache.httpcomponents'   } 

i using method, think not practice.

private static final string[] instance_projection = new string[]{         calendarcontract.instances.event_id,      // 0         calendarcontract.instances.begin,         // 1         calendarcontract.instances.end,         // 1         calendarcontract.instances.title          // 2 };  private static final int projection_id_index = 0; private static final int projection_begin_index = 1; private static final int projection_end_index = 2; private static final int projection_title_index = 3;  public long geteventid(string title) {      cursor cursor = contentresolver.query(builder.build(),             instance_projection,             null,             null,             null);      long eventidl = 0;     long beginval = 0;     long endval = 0;     string _title = null;     int size = cursor.getcount();     while (cursor.movetonext()) {          // field values         eventidl = cursor.getlong(projection_id_index);         beginval = cursor.getlong(projection_begin_index);         endval = cursor.getlong(projection_end_index);         _title = cursor.getstring(projection_title_index);          if (beginval == eventdate.getdatestart() && endval == eventdate.getdateend()) {             if (title != null && _title != null) {                 if (title.equals(_title)) {                     break;                 }             }              if (title == null && _title == null) {                 break;             }              if (title == null && _title != null && _title.isempty()) {                 break;             }              if (title != null && title.isempty() && _title != null && _title.isempty()) {                 break;             }         }     }      return eventidl; } 


Comments

Popular posts from this blog

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -