googleworkspace / android-samples

Android samples for Google Workspace APIs
Apache License 2.0
635 stars 410 forks source link

Get Specific drive folder 's list in Android #118

Closed shyamkumarm closed 5 years ago

shyamkumarm commented 5 years ago

mDriveService.files().list().setSpaces("drive").execute() // return all folders and files.

How to get the folder's and files from the specific folder using "folder ID"?

Also tried : protected Task<FileList> queryFiles() { String parentId = "1Mv62bjNcq1pef_cJ3XXeXFbunaX3UI7V"; String fileQuery = "'" + parentId + "' in parents and trashed=false"; return Tasks.call(mExecutor, () -> mDriveService.files().list().setQ(fileQuery).execute()); }

shyamkumarm commented 5 years ago

I am able to get it now, Changed the Scope "DriveScopes.DRIVE" instead of "DriveScopes.DRIVE_FILE" in the project. it works