Hector
Hector

Reputation: 5428

Delete google drive folder from trash in Android Application

I am developing an android application that integrates with google drive. My android application creates its own google drive folder to hold user documents created by the application. I want to detect when the user has deleted this application folder and its residing in the google drive TRASH. When i detect that the folder has been trashed i want to permanently delete it from inside my application. To detect the folder has been trashed i interrogate its LABELS and find key value pair "trashed"/"true". I then execute this code to delete it from the trash permanetly mService.files().delete(folder.getId()); However the folder still appears in the google drive trash. How do i permanently delete a folder from google drive trash?

Upvotes: 0

Views: 991

Answers (1)

zapbuild
zapbuild

Reputation: 310

service.files().trash(fileId).execute();
This is for moving file to trash

service.files().untrash(fileId).execute();
for delete file from trash  on server

check this link also :
https://developers.google.com/drive/v2/reference/files/trash

Upvotes: 1

Related Questions