1

In Google Drive, I'm getting this issue:

Status{statusCode=Drive item not found, or you are not authorized to access it., resolution=null}

for getting list of files from the Google Drive folder.

I am using the Google Drive Android SDK. Can you please help me on this issue?

Here is the source code which I am following:

    Drive.DriveApi.fetchDriveId(mGoogleApiClient, "DriveId:CAESABiErgEg3t2Dj4VVKAE=").setResultCallback(new ResultCallback<DriveApi.DriveIdResult>() {
            @Override
            public void onResult(DriveApi.DriveIdResult result) {

                Log.d(TAG, "Result: " + result.getStatus().toString());
                if (!result.getStatus().isSuccess()) {
                    Log.d(TAG, "Cannot find DriveId. Are you authorized to view this file?");
//                    showMessage("Cannot find DriveId. Are you authorized to view this file?");
                    return;
                }
                DriveId driveId = result.getDriveId();
                DriveFolder folder = driveId.asDriveFolder();
                Query query = new Query.Builder()
                        .addFilter(Filters.eq(SearchableField.MIME_TYPE, "audio/*"))
                        .build();
                folder.queryChildren(mGoogleApiClient, query)
                        .setResultCallback(new ResultCallback<DriveApi.MetadataBufferResult>() {
                            @Override
                            public void onResult(DriveApi.MetadataBufferResult result) {
                                if (!result.getStatus().isSuccess()) {
                                    Log.d(TAG, "Problem while retrieving files");
//                                    showMessage("Problem while retrieving files");
                                    return;
                                }

                                Log.d(TAG, "result.getMetadataBuffer(): " + result.getMetadataBuffer());
                                /*mResultsAdapter.clear();
                                mResultsAdapter.append(result.getMetadataBuffer());
                                showMessage("Successfully listed files.");*/
                            }
                        });
            }
        });
Pang
  • 9,564
  • 146
  • 81
  • 122
Aspl Test
  • 133
  • 1
  • 10
  • Check this [SO question](http://stackoverflow.com/questions/22140319/creating-a-folder-inside-a-folder-in-google-drive-android) and this [issue](https://github.com/googledrive/android-quickstart/issues/4) if it can help you ;) – KENdi Apr 27 '16 at 02:52

0 Answers0