相关疑难解决方法(0)

在片段中使用enableAutoManage()

还有其他方法可以连接Google API客户端吗?

我使用自动完成的地方,我必须在MYFRAGMENT的某些地方使用此代码

mGoogleApiClient = new GoogleApiClient.Builder(MainActivity.this)
                .addApi(Places.GEO_DATA_API)
                .enableAutoManage(this, GOOGLE_API_CLIENT_ID, this)
                .addConnectionCallbacks(this).build();
Run Code Online (Sandbox Code Playgroud)

我的问题

enableAutoManage(this, GOOGLE_API_CLIENT_ID, this)
                    .addConnectionCallbacks(this).build();
Run Code Online (Sandbox Code Playgroud)

我不能处理它,因为当我替换我时this,getActivity()我有许多铸造问题

感谢您的帮助,如果这个问题很愚蠢,我很抱歉.

android google-api-client android-fragments google-places-api

24
推荐指数
1
解决办法
2万
查看次数