mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-26 20:33:07 +08:00
Update
This commit is contained in:
parent
d44d9ddca6
commit
01abb32025
@ -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.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user