Drive.DriveApi.getAppFolder(mGoogleApiClient) deprecated

邮差的信 提交于 2019-12-20 06:15:38

问题


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:


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.



来源:https://stackoverflow.com/questions/47835372/drive-driveapi-getappfoldermgoogleapiclient-deprecated

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!