i'm developing an app using google drive SDK currently on Android using eclipse, i encounter an error which happen everytime i try to update modified date from file that i upload. this my code.
com.google.api.services.drive.model.File f=null;
File a=new File(file[1]);
com.google.api.services.drive.model.File body = new com.google.api.services.drive.model.File();
body.setTitle(file[1].substring(file[1].lastIndexOf("/")+1, file[1].length()));
Uri selectedUri = Uri.fromFile(a);
String fileExtension
= MimeTypeMap.getFileExtensionFromUrl(selectedUri.toString());
String mimeType
= MimeTypeMap.getSingleton().getMimeTypeFromExtension(fileExtension);
body.setMimeType(mimeType);
System.out.println(DateTime.parseRfc3339(file[2]));
body.setModifiedDate(DateTime.parseRfc3339(file[2]));
//this modified date code causing error
FileContent mediaContent = new FileContent(mimeType, a);
try {
f = service.files().insert(body, mediaContent).setConvert(true).execute();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
handleException(e);
}
can someone tell me how to setModifiedDate in correct way, i'm totally stuck here..
thanks in advance