public class ZendriveLocationSettingsResult
extends java.lang.Object
implements android.os.Parcelable
onLocationSettingsChange
callback.Modifier and Type | Class and Description |
---|---|
static class |
ZendriveLocationSettingsResult.Error
Indicates the error in location settings on the device.
|
Modifier and Type | Field and Description |
---|---|
static android.os.Parcelable.Creator<ZendriveLocationSettingsResult> |
CREATOR |
java.util.List<ZendriveLocationSettingsResult.Error> |
errors
Errors found when determining location settings status on the device.
|
LocationSettingsResult |
locationSettingsResultFromGooglePlayService
The location settings result obtained from Google Play Services API.
|
Constructor and Description |
---|
ZendriveLocationSettingsResult() |
Modifier and Type | Method and Description |
---|---|
int |
describeContents()
Describe the kinds of special objects contained in this Parcelable's
marshalled representation.
|
boolean |
isSuccess()
Indicates if the location settings on the device are setup correctly as required by
Zendrive SDK.
|
void |
writeToParcel(android.os.Parcel dest,
int flags)
Flatten this object in to a Parcel.
|
public java.util.List<ZendriveLocationSettingsResult.Error> errors
public LocationSettingsResult locationSettingsResultFromGooglePlayService
errors
contains ZendriveLocationSettingsResult.Error.GOOGLE_PLAY_SERVICES_ERROR_RESULT
or
The application must handle this result as recommended by the
Google Developer Guide.
Here is a sample snippet.
switch (result.getStatus().getStatusCode()) {
case LocationSettingsStatusCodes.SUCCESS:
// All location settings are satisfied.
...
break;
case LocationSettingsStatusCodes.RESOLUTION_REQUIRED:
// Location settings are not satisfied. But could be fixed by showing the user
// a dialog.
try {
// Show the dialog by calling startResolutionForResult(),
// and check the result in onActivityResult().
status.startResolutionForResult(getActivity(),
REQUEST_CHECK_SETTINGS);
} catch (SendIntentException e) {
...
}
break;
case LocationSettingsStatusCodes.SETTINGS_CHANGE_UNAVAILABLE:
// Location settings are not satisfied. However, we have no way to fix the
// settings so we won't show the dialog.
// Message appropriately to user.
...
break;
}
See Google Developer Guide
for more details.public static final android.os.Parcelable.Creator<ZendriveLocationSettingsResult> CREATOR
public boolean isSuccess()
public int describeContents()
android.os.Parcelable
describeContents
in interface android.os.Parcelable
public void writeToParcel(android.os.Parcel dest, int flags)
android.os.Parcelable
writeToParcel
in interface android.os.Parcelable
dest
- The Parcel in which the object should be written.flags
- Additional flags about how the object should be written.
May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE
.