Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android 通过BackAndroid退出App之后再次进去App定位,不会触发listener. #9

Closed
AdamChrist opened this issue Feb 20, 2017 · 8 comments
Labels

Comments

@AdamChrist
Copy link

react-native 版本: 0.41.2
Android中的onLocationChanged也不会触发
具体原因不明,一定要杀掉App进程,再次进去才可以.

@KevinOfNeu
Copy link
Contributor

@AdamChrist Android 设备型号,系统版本等可以提供一下吗?我这里复现一下

@AdamChrist
Copy link
Author

@KevinOfNeu 小米Note2 MIUI8 Android 5.0.2

@AdamChrist
Copy link
Author

@KevinOfNeu 又用华为的荣耀6 EMUI4 Android 6.0 测试了一下..还是一样的问题.

@KevinOfNeu
Copy link
Contributor

@AdamChrist 触发location Change 的代码,然后你贴一下你的代码我看下,我这边暂时不能复现,我可以先帮你看下是否是用法上的问题

@AdamChrist
Copy link
Author

AdamChrist commented Feb 21, 2017

@KevinOfNeu 我最近尝试使用react-navigation,所以正好写在这个Demo中.高德的Key还是用的之前的App的..所以得不到数据,但是还是能看到效果..使用后退键退出之后在进入那个Location的界面,不会触发listener.
https://github.com/AdamChrist/ReactNavigationDemo
在目录中的Link to Location
非常感谢.

@KevinOfNeu
Copy link
Contributor

@AdamChrist 我看了你代码,有一处可能导致此问题,代码onceLocation: false, // 是否只定位一次,设置为 true 的话定位一次后,就结束了。改成 false 试试,我这边 HOME 到后台,console 可以持续输出 {"errorInfo":"KEY错误 请到http://lbs.amap.com/api/android-location-sdk/abouterrorcode/查看错误码说明.","errorCode":7}

@AdamChrist
Copy link
Author

@KevinOfNeu
https://youtu.be/mW3TfM5hkC4
我已经从windows换到了mac环境.location的参数已经改了.问题依旧,囧....
详情可以看下视频

@KevinOfNeu KevinOfNeu added the bug label Feb 21, 2017
KevinOfNeu added a commit that referenced this issue Feb 21, 2017
@KevinOfNeu
Copy link
Contributor

KevinOfNeu commented Feb 21, 2017

@AdamChrist #10 此问题已修复, 可以使用 0.2.1 这个版本。

@cooclsee cooclsee mentioned this issue Feb 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants