In my app, I wanna use both location provider.
That means, if the gps is disabled I want my app to switch to network, and when gps is enabled to switch back it.
I'm using two LocationListener to handle those two requests.
public void onStatusChanged(String provider, int status,Bundle extras)
switch (status) {
case LocationProvider.TEMPORARILY_UNAVAILABLE:
......
break;
case LocationProvider.OUT_OF_SERVICE
.....
break;
case LocationProvider.AVAILABLE
.....
break;
}
And in the each listener ,I detect those status in the onStatusChanged()
.
It turns out, this method will be used in the first change(disabled network),but when I enable the network again, it shows nothing.Why was that? The listener won't detect the status all the time??
Please help me, it would be best to post you solution in code...Thanks!