【发布时间】:2015-01-20 17:43:49
【问题描述】:
我正在 Android 示例表盘上进行编码。我想连接到 Google Play 服务以获取我当前的位置,并将其放入我的 OnCreate 方法中:
mGoogleApiClient = new GoogleApiClient.Builder(this)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.addApi(LocationServices.API)
.build();
像这样:
我的错误如下:
第一个 this 不能应用于引擎。 mGoogleApiClient,LocationServices 无法解析为符号。我已经尝试实现/扩展我的 Engine 类,但这是不允许的。问题可能出在我放入此代码的类,因为它的组织方式可能不同?我怎样才能使这项工作?谢谢。
【问题讨论】:
标签: android google-play-services wear-os android-location android-context