Rookie
Rookie

Reputation: 8790

getLocationUpdates() giving illegal argument exception on 4.0 emulator

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, this);

it throws :

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)

Here is the link: http://code.google.com/p/android/issues/detail?id=19857

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

Upvotes: 2

Views: 1150

Answers (2)

Sachidananda Naik
Sachidananda Naik

Reputation: 151

see this thread,this will do it for you... if you are working in the emulator... Link

Upvotes: 0

V.J.
V.J.

Reputation: 9580

Please first implements implements LocationListener if you have not written.

otherwise

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

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

Upvotes: 1

Related Questions