mlocationClient无法解决
-
20-12-2019 - |
题
我使用Google播放位置服务存在问题。我试图遵循 http://developer.android.com/training/location/Retrieve-current.html或更少。然而,Eclipse告诉我它无法解决我的位置。我的代码如下所示:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
overridePendingTransition(0,0);
mLocationClient = new LocationClient(this, this, this);
if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction()
.add(R.id.container, new PlaceholderFragment()).commit();
}
}
@Override
protected void onStart() {
super.onStart();
// Connect the client.
mLocationClient.connect();
}
.
我有一种感觉,那个谷歌游戏服务库没有正确引用,但是当我到达我项目的属性时,它旁边有一个绿色的复选标记。如果您需要更多代码,请告诉我。提前谢谢!
解决方案
关闭并重新打开项目。
清洁并重建项目。
确保您已将正确的导入添加到您的活动类。
确保您有私有位置额外的mlocationClient;在您的活动中定义。
不隶属于 StackOverflow