Cannot get position from Network
I'm trying to get the location based on network. I've declared in the manifest
I've registered the listener and requested location updates :
locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, listener);
The problem is that I don't receive any location updates in listener's onLocationChanged() This only happens for devices with API level 8 and above Samsung Galaxy S , Google Nexus One for pre 2.2 devices (e.g Htc Desire) works fine.
after requesting updates from network provider I've checked if NETWORK_PROVIDER is enabled:
Criteria criteria =new Criteria();
criteria.setAccuracy(Criteria.ACC开发者_如何学CURACY_FINE);
Log.d(TAG,"best app provider:"+locationManager.getBestProvider(criteria, true));
Log.d(TAG,"is network enabled:"+locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER));
and returned: best app provider:network is network enabled:true
so everything seems to be fine except no position is received by the listener.
can anyone give me hint if something changed in the api? do I have to set up something else?
精彩评论