Skip to content Skip to sidebar Skip to footer

Listchildren Returning Zero Count On Rootfolder - Googledrive Apimet

I am getting zero child from the root folder while accessing my drive. DriveFolder mFolder = Drive.DriveApi.getRootFolder(mClient); mFolder.listChildren(mClient).setResultCallback(

Solution 1:

Not an answer; just easier to post code you requested here:

mGoogleApiClient = new GoogleApiClient.Builder(SyncSettingsActivity.this)
        .addApi(Drive.API)
        .addScope(Drive.SCOPE_FILE)
        .addConnectionCallbacks(SyncSettingsActivity.this)
        .addOnConnectionFailedListener(SyncSettingsActivity.this)
        .build();

Solution 2:

The problem was with scope. Google play service library only supports Scope FILE_SCOPE and APP_FOLDER_SCOPE both can get file which is created with the application. The service library doesnot support full drive access. For this reason listChildren was returning 0 elements (meaning there was no file which was created by this application).

Post a Comment for "Listchildren Returning Zero Count On Rootfolder - Googledrive Apimet"