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

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -