Google Drive Android API - list of files from folder is ALWAYS outdated / cached, not fresh -


I am trying to list files from my Google Drive. I am using the official copy method from Docs, but it does not return valid results - it lists some recently deleted files and does not list some recently created files It seems that this Is cached and takes enough time (minutes, sometimes even hours) to show any changes. Anyone know how to get real time and valid - old and not cached - Drive the list of files from Google I am using this method:

  // I need to get Root directory query list of the files that were trashed = new Query.Builder () addFilter (Filters.eq (SearchableField.TRASHED, wrong) .build (); DriveFolder folder = Drive.DriveApi.getRootFolder (mGoogleApiClient); MetadataBufferResult filesMetadata = folder.queryChildren (mGoogleApiClient, query) .await (); if (filesMetadata.getStatus () isSuccess () !.) {log ( "failed"); return false;} iterator & LT; metadata & gt; it filesMetadata. getMetadataBuffer = (). iterator (); while (ItkhasNext ()) {metadata meta = Itknext (), log ( "file name:" + MetakgetTitle () + ', size: "+ Meta.getFileSize () + ', created: "+ meta.getCreatedDate ());} // But this list is not available  

Google Drive API does not reflect the latest changes,

immediately after that does not sync, you have to force Google drive to sync using the following method call:

  Drive.DriveApi.requestSync (_gac);  

Comments

Popular posts from this blog

winforms - C# Form - Property Change -

javascript - amcharts makechart not working -

java - Algorithm negotiation fail SSH in Jenkins -