• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps NETWORK_PROVIDER problems

Hi! I am develop an location application and when the location is disable, the aplication must read location from NETWORK_PROVIDER, but this provider is working only when location is enable.
Can you explain me why NETWORK_PROVIDER is not working on wifi/3g/4g?
Sorry for my english.
Regards,
 
Last edited:
this are from log
=press location button=
04-04 15:34:04.827 16499-16499/com.example.catalin.licenta_ultimate E/BOOMB: onProviderDisabled: network
04-04 15:34:04.855 16499-16499/com.example.catalin.licenta_ultimate E/BOOMB: onProviderDisabled: gps
=press location button=
04-04 16:14:10.117 15236-15236/com.example.catalin.licenta_ultimate E/BOOMB: onProviderEnabled: network
04-04 16:14:10.147 15236-15236/com.example.catalin.licenta_ultimate E/BOOMB: onProviderEnabled: gps
either i press wifi button or cellular data there aren`t no changes for network provider

I don`t know if it`s from service this bug or from aplication
 
Please post the relevant parts of the code in this thread. If the application crashed, post a stack trace. Thanks.
 
No, the app is not cashing, but the network_provider works like a gps_provider because when i pres the wifi/ or cellular data buttons the LocationListener is not responding , and when I press Location Button it responds, do you understand or I explain again?
 
In my service I had this :

public void onProviderDisabled(String provider)
{
Log.e(TAG, "onProviderDisabled: " + provider);
}
@override
public void onProviderEnabled(String provider)
{
Log.e(TAG, "onProviderEnabled: " + provider);
}
....
LocationListener[] mLocationListeners = new LocationListener[] {
new LocationListener(LocationManager.GPS_PROVIDER),
new LocationListener(LocationManager.NETWORK_PROVIDER)
};

This is how i see what provider is enable or disable
 
Back
Top Bottom