Drive.DriveApi.getAppFolder(mGoogleApiClient) depr

2020-05-06 10:23发布

While trying to set up the Google Drive API for Android, In this line

Drive.DriveApi.getAppFolder(mGoogleApiClient)

I'm getting that both, DriveApi and getAppFolder are deprecated.

What should I replace it with?

1条回答
我欲成王,谁敢阻挡
2楼-- · 2020-05-06 10:47

The deprecation was officially announced in this reference page:

This interface was deprecated. Gain access to the Drive API with one of the Drive#get*Client() methods instead.

This was replaced with methods like getDriveClient and you can see sample code demos in googledrive/android-demos:

private void initializeDriveClient(GoogleSignInAccount signInAccount) {
        mDriveClient = Drive.getDriveClient(getApplicationContext(), signInAccount);
        mDriveResourceClient = Drive.getDriveResourceClient(getApplicationContext(), signInAccount);
        onDriveClientReady();
    }

Check the Drive API for Android for more info.

查看更多
登录 后发表回答