getLocationUpdates()上的4.0模拟器给予非法参数异常 [英] getLocationUpdates() giving illegal argument exception on 4.0 emulator

查看:253
本文介绍了getLocationUpdates()上的4.0模拟器给予非法参数异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 code.google.com 看到有在法getLocationUpdate()当我们尝试以下错误:

I saw on code.google.com that there is a bug in method getLocationUpdate() when we try the following:

requestLocationUpdates(LocationManager.NETWORK_PROVIDER,1000L,500.0f,这一点);

它抛出:

09-06 22:46:16.163: ERROR/AndroidRuntime(351): Caused by: java.lang.IllegalArgumentException: provider=network
09-06 22:46:16.163: ERROR/AndroidRuntime(351):     at android.os.Parcel.readException(Parcel.java:1325)
09-06 22:46:16.163: ERROR/AndroidRuntime(351):     at android.os.Parcel.readException(Parcel.java:1275)
09-06 22:46:16.163: ERROR/AndroidRuntime(351):     at android.location.ILocationManager$Stub$Proxy.requestLocationUpdates(ILocationManager.java:646)
09-06 22:46:16.163: ERROR/AndroidRuntime(351):     at android.location.LocationManager._requestLocationUpdates(LocationManager.java:582)
09-06 22:46:16.163: ERROR/AndroidRuntime(351):     at android.location.LocationManager.requestLocationUpdates(LocationManager.java:446)

下面是链接:的http:// code.google.com / p /安卓/问题/细节?ID = 19857

我想知道的是这个固定yet.My应用程序崩溃它会尝试获取位置更新每次。

I want to know is this fixed yet.My app is crashing everytime it tries to get the location update.

推荐答案

请第一器具实施LocationListener的如果您还没有写。

Please first implements implements LocationListener if you have not written.

,否则

试试这个链接的获取当前纬度经度我有解决我的问题与此链接。
试试这个...
祝您好运。

Try this link Get current Lat Lon i have solve my problem with this link. Try this one... Best of luck

和也尽量使用 LocationManager.GPS_PROVIDER LocationManager.NETWORK_PROVIDER istead。

And also try with using LocationManager.NETWORK_PROVIDER istead of LocationManager.GPS_PROVIDER.

这篇关于getLocationUpdates()上的4.0模拟器给予非法参数异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆