小编And*_*rew的帖子

Google Places Api出错(.addConnectionCallbacks)

public class Places_DATA extends ActionBarActivity
{
private GoogleApiClient mGoogleApiClient;
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_places);


    mGoogleApiClient = new GoogleApiClient
            .Builder(this)
            .addApi(Places.GEO_DATA_API)
            .addApi(Places.PLACE_DETECTION_API)
            .addConnectionCallbacks(this)
            .addOnConnectionFailedListener(this)
            .build();
}
Run Code Online (Sandbox Code Playgroud)

问题是我继续使用.addConnectionCallbacks(this)收到错误.该错误表明.ConnectionCallbacks无法添加到类中.我不确定我做错了什么,因为我一直关注谷歌的文档,如下所示:https://developers.google.com/places/android/start

android google-api google-places-api android-studio

1
推荐指数
1
解决办法
4242
查看次数