mLocationClient不能得到解决

mLocationClient不能得到解决

本文介绍了mLocationClient不能得到解决的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用谷歌播放位置服务有问题。我试图按照更多或更少。但是Eclipse的告诉我,它解决不了我的LocationClient。我的code是这样的:

I have a problem using the Google Play location services. I was trying to follow http://developer.android.com/training/location/retrieve-current.html more or less. However Eclipse tells me that it cannot resolve my LocationClient. My code looks like this:

    @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();
}

我有一种感觉,认为谷歌播放服务库不被引用正确,但是当我到我的项目的属性,还有旁边有一个绿色的对勾。如果您需要更多code让我知道。在此先感谢!

I got a feeling, that the google-play-services library is not referenced proper, but when I got to the properties of my project there is a green check mark next to it. If you need more code let me know. Thanks in advance!

推荐答案

关闭并重新打开您的项目。

Close and reopen your project.

清理并重新构建项目。

请确保您已经添加了正确的导入到你的活动类。

Make sure you've added the correct imports to your activity class.

请确保您有私人LocationClient mLocationClient;在您的活动定义。

Make sure you have private LocationClient mLocationClient; defined in your activity.

这篇关于mLocationClient不能得到解决的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 00:44