I know that the version returned is old, because if I use the Drive application on my device, it returns the correct, latest version of the same file. The drive contents I read as follows: final DriveContents driveContents = result.getDriveContents() įinal InputStream inputStream = driveContents.getInputStream() įinal File newFile = new File("fileName") įinal FileOutputStream dest = new FileOutputStream(newFile) Īny ideas why it's happening and how to fix it? setResultCallback(fileContentsCallback) open(apiClient, DriveFile.MODE_READ_ONLY, null) I read the file as follows: driveId.asDriveFile() setResultCallback(lastModifiedCallback) īut when I query the file contents, it returns some older version of it. addFilter(Filters.eq(SearchableField.TRASHED, false)) addFilter(Filters.eq(SearchableField.TITLE, "fileName")) addSortDescending(SortableField.MODIFIED_DATE) It returns the correct datetime when the file was updated: final SortOrder sortOrder = new SortOrder.Builder() To see that a file exists and get it's latest version, I do a Query search by that file name and sorting by modified date descending. Since some time ago it started behaving really strange. I'm using Drive Android API to sync a file between devices and to hold the latest version on Drive.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |