Search code examples
network-programminglocationandroid-4.0-ice-cream-sandwichprovider

LocationManager.NETWORK_PROVIDER is not triggering onLocationChanged in ICS


Does anybody know what happened with event-listener for location changed for WI-FI provider. I saw a lot of questions about this but no proper answer.

I'm doing everything fine and it is working for older versions of android, but now I updated my SAMSUNG GALAXY TAB 10.1 to ICS and it is not working anymore. Maybe this is a SAMSUNG (or my mobile provider) bug when they implemented their UI into ICS...

I'm registering eventlistener like this (have in mind that it works good in prevous versions of android and I also enabled all location services in settings):

locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, loclistener); //refresh time and distance are to 0 so it should trigger location change event

After this request I checked if network provider is enabled and it shows like it is.

Code:

if (locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER)) {
   Toast.makeText(this, "NETWORK PROVIDER enabled!", Toast.LENGTH_LONG).show();
   }

If someone has an idea please help me...


Solution

  • This is known issue:

    After device reboot the network location provider works fine but after some time it stops updating.

    https://code.google.com/p/android/issues/detail?id=57707

    Unfortunately without solution yet.