This commit is contained in:
Bryce Curtis 2012-05-14 23:18:26 -05:00
parent d44d9ddca6
commit 01abb32025

View File

@ -55,7 +55,7 @@ public class GeoBroker extends Plugin {
*/
public PluginResult execute(String action, JSONArray args, String callbackId) {
if (this.locationManager == null) {
this.locationManager = (LocationManager) this.ctx.getSystemService(Context.LOCATION_SERVICE);
this.locationManager = (LocationManager) this.ctx.getActivity().getSystemService(Context.LOCATION_SERVICE);
this.networkListener = new NetworkListener(this.locationManager, this);
this.gpsListener = new GPSListener(this.locationManager, this);
}
@ -150,13 +150,14 @@ public class GeoBroker extends Plugin {
e.printStackTrace();
}
return o;
}
public void win(Location loc, String callbackId) {
PluginResult result = new PluginResult(PluginResult.Status.OK, this.returnLocationJSON(loc));
this.success(result, callbackId);
}
/**
* Location failed. Send error back to JavaScript.
*