locationclient.getlastlocation()始终在模拟器上返回null

Pra*_*tik 3 android location-client

我是Android世界的新手.我刚刚从Google推荐这个教程:http: //developer.android.com/training/location/retrieve-current.html

程序编译很好并在模拟器上启动应用程序,但是当我尝试找到mLocationClient.getLastLocation()时它返回null,总是

我搜索了将近一天,并且已经尝试从DDMS,telnet发送参数,切换谷歌MAP但仍然没有成功.

请帮帮我.

Jad*_*ugh 10

最终对我有用的是设置位置(我使用Genymotion,右上角的"GPS小部件"),然后启动谷歌地图,然后运行我的应用程序.

我的猜测是我的应用程序实际上没有设置当前位置(我认为连接我的locationClient会自动执行) - Google Maps检查并设置位置,因此getLastLocation实际上有一些东西要返回.