mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-31 17:32:51 +08:00
Added fail callback to Android GpsListener/GeoListener.
This commit is contained in:
parent
21612ac346
commit
d701f41b76
@ -44,7 +44,13 @@ public class GeoListener {
|
||||
void fail()
|
||||
{
|
||||
// Do we need to know why? How would we handle this?
|
||||
mAppView.loadUrl("javascript:GeoLocation.fail(" + id + ")");
|
||||
if (id != "global") {
|
||||
mAppView.loadUrl("javascript:Geolocation.fail(" + id + ")");
|
||||
}
|
||||
else
|
||||
{
|
||||
mAppView.loadUrl("javascript:Geolocation.fail()");
|
||||
}
|
||||
}
|
||||
|
||||
// This stops the listener
|
||||
|
@ -54,6 +54,7 @@ public class GpsListener implements LocationListener {
|
||||
public void onProviderDisabled(String provider) {
|
||||
// TODO Auto-generated method stub
|
||||
Log.d(LOG_TAG, "The provider " + provider + " is disabled");
|
||||
owner.fail();
|
||||
}
|
||||
|
||||
public void onProviderEnabled(String provider) {
|
||||
@ -68,6 +69,7 @@ public class GpsListener implements LocationListener {
|
||||
if(status == 0)
|
||||
{
|
||||
Log.d(LOG_TAG, provider + " is OUT OF SERVICE");
|
||||
owner.fail();
|
||||
}
|
||||
else if(status == 1)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user