googleworkspace / android-samples

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

how to get resource id of pro grammatically created folder? #36

Closed Slake07 closed 9 years ago

Slake07 commented 9 years ago

i want to store resource id of dynamically created folder in google drive using API for creating file inside it. how can i get that? i already tried below code but it always returns null.

Log.e("UPLO", "RES ID: " + folder.getDriveId().getResourceId());

i also tried waiting for 5 seconds and then fetch resourceID from stored driveid of folder but still getting null.

kroikie commented 9 years ago

The resource id is not available until the created folder is synced to the server. Completion events can be used to let you know when syncing to the server is complete. Check android-conflict for an example of using completion events and see the documentation here.