Hi all; I searched the group, but found nothing on the subject.
Here's what I'm seeing:
I have a remote service. If I enable the location provider from my
onCreate() entry point:
public void onCreate() {
super.onCreate();
locationManager =
(LocationManager) getSystemService(Context.LOCATION_SERVICE);
locationListener = new MyLocationListener();
enableLocation();
}
private void enableLocation() {
String provider = "network";
Log.d(TAG, "enableLocation() Enable provider " + provider);
locationManager.requestLocationUpdates(provider,
10000, 0, locationListener);
Log.d(TAG, " enabled " + provider);
}
it works perfectly. If I try to do it from my service stub:
private final ITestService.Stub testBinder = new ITestService.Stub()
{
public void setLocating(boolean flag) {
Log.d(TAG, "setLocating(" + flag + ")");
switchLocating(flag);
}
};
private void switchLocating(boolean on) {
locatingOn = on;
if (on)
enableLocation();
else
disableLocation();
}
the call to requestLocationUpdates() never returns.
Has anybody seen this behavior before? Is there a work-around?
(Full source in http://www.efalk.org/tester.zip)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---