I am trying to get user location either network location or gps
location or both. for that i am running a background service which implements LocationListener
As you said, you are not even getting toast of "Getting location Via Network". So your execution is not going inside the if block of
if (lm.isProviderEnabled(LocationManager.NETWORK_PROVIDER)) {
}
So make sure you have checked
Google's location services - Checked
in your device Settings.
Settings > location services > Google's location services and Access Location.
Then you should get location from LocationManager
. Else rest of your code looks fine.
Hope this helps.
Reference link