简体   繁体   English

无法将位置发送到Android模拟器

[英]Can't send location to Android emulator

So I have all the permissions I need in my Android project to get locations, but no matter what I do, I can't send a mock location to the device. 因此,我拥有在Android项目中获取位置所需的所有权限,但是无论我做什么,我都无法将模拟位置发送到设备。 I've tried using geo fix from the console, I've tried using the DDMS perspective from Eclipse, and just about everything else. 我尝试从控制台使用geo fix ,也尝试从Eclipse使用DDMS透视图 ,以及其他所有方面。

My emulator simply refuses to get the location. 我的模拟器只是拒绝获取位置。 And I know it isn't a bug in my code, because sometimes it will work. 而且我知道这不是代码中的错误,因为有时它会起作用。

What do? 做什么?

After much trouble trying to do this, I found that one of the following generally fixed things: 尝试这样做很麻烦之后,我发现以下通常已解决的问题之一:

Go to the emulator, head over to Settings. 转到模拟器,转到“设置”。 Scroll down to location access, and turn off "Access to my location". 向下滚动到位置访问,然后关闭“访问我的位置”。 Then turn it back on. 然后重新打开。 Try sending the location from the DDMS perspective or geo fix , again. 尝试从DDMS角度或发送位置geo fix ,再次。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM