java - Google Calendar API android create event -
i`m trying create event file (.pdf) in android app google calendar api: create events
public static void addattachment(calendar calendarservice, drive driveservice, string calendarid, string eventid, string fileid) throws ioexception { file file = driveservice, android .files().get(fileid).execute(); event event = calendarservice.events().get(calendarid, eventid).execute(); list<eventattachment> attachments = event.getattachments(); if (attachments == null) { attachments = new arraylist<eventattachment>(); } attachments.add(new eventattachment() .setfileurl(file.getalternatelink()) .setmimetype(file.getmimetype()) .settitle(file.gettitle())); event changes = new event() .setattachments(attachments); calendarservice.events().patch(calendarid, eventid, changes) .setsupportsattachments(true) .execute(); }
i copy totaly doesnt work,android studio put in red getalternatelink() , gettitle()doesnt reconize, lines:
attachments.add(new eventattachment() .setfileurl(file.getalternatelink()) .setmimetype(file.getmimetype()) .settitle(file.gettitle()));
in drive:v3 doesnt exit getalternatelink() change de version v2 in app
// compile('com.google.apis:google-api-services-drive:v3-rev64-1.22.0') { // exclude group: 'org.apache.httpcomponents' // }
put this
compile('com.google.apis:google-api-services-drive:v2-rev123-1.18.0-rc'){ exclude group: 'org.apache.httpcomponents' }
Comments
Post a Comment