Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Nested Classes](https://developer.android.com/reference/android/service/settings/preferences/SetValueResult#nestedclasses) \| [Constants](https://developer.android.com/reference/android/service/settings/preferences/SetValueResult#constants) \| [Inherited Constants](https://developer.android.com/reference/android/service/settings/preferences/SetValueResult#inhconstants) \| [Fields](https://developer.android.com/reference/android/service/settings/preferences/SetValueResult#lfields) \| [Methods](https://developer.android.com/reference/android/service/settings/preferences/SetValueResult#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/service/settings/preferences/SetValueResult#inhmethods)

# SetValueResult

*** ** * ** ***

` public final class SetValueResult `   
` extends https://developer.android.com/reference/java/lang/Object ` ` implements https://developer.android.com/reference/android/os/Parcelable `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.service.settings.preferences.SetValueResult |

<br />

*** ** * ** ***

Result object given a corresponding `https://developer.android.com/reference/android/service/settings/preferences/SetValueRequest`.

- If the request was successful, `https://developer.android.com/reference/android/service/settings/preferences/SetValueResult#getResultCode()` will be `https://developer.android.com/reference/android/service/settings/preferences/SetValueResult#RESULT_OK`.
- If the request is unsuccessful, `https://developer.android.com/reference/android/service/settings/preferences/SetValueResult#getResultCode()` be a value other than `https://developer.android.com/reference/android/service/settings/preferences/SetValueResult#RESULT_OK` - see documentation for those possibilities to understand the cause of the failure.

<br />

## Summary

| ### Nested classes ||
|---|---|
| ` class` | `https://developer.android.com/reference/android/service/settings/preferences/SetValueResult.Builder` Builder to construct `https://developer.android.com/reference/android/service/settings/preferences/SetValueResult`. |

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/service/settings/preferences/SetValueResult#RESULT_DISABLED` Requested preference is disabled, thus unable to be set in this state. |
| `int` | `https://developer.android.com/reference/android/service/settings/preferences/SetValueResult#RESULT_DISALLOW` Requested preference is not allowed for access in this API under the current device policy. |
| `int` | `https://developer.android.com/reference/android/service/settings/preferences/SetValueResult#RESULT_INTERNAL_ERROR` API call failed due to an issue with the service binding. |
| `int` | `https://developer.android.com/reference/android/service/settings/preferences/SetValueResult#RESULT_INVALID_REQUEST` Request object is not valid. |
| `int` | `https://developer.android.com/reference/android/service/settings/preferences/SetValueResult#RESULT_OK` Request is successful and the value was set. |
| `int` | `https://developer.android.com/reference/android/service/settings/preferences/SetValueResult#RESULT_REQUIRE_APP_PERMISSION` Requested preference requires permissions not held by the calling application. |
| `int` | `https://developer.android.com/reference/android/service/settings/preferences/SetValueResult#RESULT_REQUIRE_USER_CONSENT` User consent was not approved for this operation. |
| `int` | `https://developer.android.com/reference/android/service/settings/preferences/SetValueResult#RESULT_RESTRICTED` Requested preference is restricted, thus unable to be set under this policy. |
| `int` | `https://developer.android.com/reference/android/service/settings/preferences/SetValueResult#RESULT_UNAVAILABLE` Preference is currently not available, likely due to device state or the state of a dependency. |
| `int` | `https://developer.android.com/reference/android/service/settings/preferences/SetValueResult#RESULT_UNSUPPORTED` Requested preference is not supported by this API. |

### Inherited constants

From interface `https://developer.android.com/reference/android/os/Parcelable` `int` `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR`

Descriptor bit used with `https://developer.android.com/reference/android/os/Parcelable#describeContents()`: indicates that the Parcelable object's flattened representation includes a file descriptor.
`int` `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE`

Flag for use with `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`: the object being written is a return value, that is the result of a function such as "`Parcelable someFunction()`", "`void someFunction(out Parcelable)`", or "`void someFunction(inout Parcelable)`".

| ### Fields ||
|---|---|
| ` public static final https://developer.android.com/reference/android/os/Parcelable.Creator<https://developer.android.com/reference/android/service/settings/preferences/SetValueResult>` | `https://developer.android.com/reference/android/service/settings/preferences/SetValueResult#CREATOR` Parcelable Creator for `https://developer.android.com/reference/android/service/settings/preferences/SetValueResult`. |

| ### Public methods ||
|---|---|
| ` int` | ` https://developer.android.com/reference/android/service/settings/preferences/SetValueResult#describeContents()() ` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
| ` int` | ` https://developer.android.com/reference/android/service/settings/preferences/SetValueResult#getResultCode()() ` Returns the result code indicating status of the request. |
| ` void` | ` https://developer.android.com/reference/android/service/settings/preferences/SetValueResult#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel dest, int flags) ` Flatten this object in to a Parcel. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.
From interface ` https://developer.android.com/reference/android/os/Parcelable ` ` abstract int` ` https://developer.android.com/reference/android/os/Parcelable#describeContents()() `

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.
` abstract void` ` https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel dest, int flags) `

Flatten this object in to a Parcel.

## Constants

### RESULT_DISABLED

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int RESULT_DISABLED
```

Requested preference is disabled, thus unable to be set in this state.

Retry may succeed if underlying conditions change.

<br />

Constant Value: 2 (0x00000002)

### RESULT_DISALLOW

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int RESULT_DISALLOW
```

Requested preference is not allowed for access in this API under the current device policy.

Retry may succeed if underlying conditions change.

<br />

Constant Value: 7 (0x00000007)

### RESULT_INTERNAL_ERROR

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int RESULT_INTERNAL_ERROR
```

API call failed due to an issue with the service binding.

Retry may succeed.

<br />

Constant Value: 9 (0x00000009)

### RESULT_INVALID_REQUEST

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int RESULT_INVALID_REQUEST
```

Request object is not valid.

Retry not advised with current parameters.

<br />

Constant Value: 8 (0x00000008)

### RESULT_OK

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int RESULT_OK
```

Request is successful and the value was set.

<br />

Constant Value: 0 (0x00000000)

### RESULT_REQUIRE_APP_PERMISSION

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int RESULT_REQUIRE_APP_PERMISSION
```

Requested preference requires permissions not held by the calling application.

Retry may succeed if necessary permissions are obtained.

<br />

Constant Value: 5 (0x00000005)

### RESULT_REQUIRE_USER_CONSENT

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int RESULT_REQUIRE_USER_CONSENT
```

User consent was not approved for this operation.

Retry may succeed if user provides consent.

<br />

Constant Value: 6 (0x00000006)

### RESULT_RESTRICTED

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int RESULT_RESTRICTED
```

Requested preference is restricted, thus unable to be set under this policy.

Retry may succeed if underlying conditions change.

<br />

Constant Value: 3 (0x00000003)

### RESULT_UNAVAILABLE

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int RESULT_UNAVAILABLE
```

Preference is currently not available, likely due to device state or the state of a dependency.

Retry may succeed if underlying conditions change.

<br />

Constant Value: 4 (0x00000004)

### RESULT_UNSUPPORTED

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int RESULT_UNSUPPORTED
```

Requested preference is not supported by this API.

Retry not advised.

<br />

Constant Value: 1 (0x00000001)

## Fields

### CREATOR

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final Creator<SetValueResult> CREATOR
```

Parcelable Creator for `https://developer.android.com/reference/android/service/settings/preferences/SetValueResult`.

<br />

## Public methods

### describeContents

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int describeContents ()
```

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`, the return value of this method must include the `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` bit.

<br />

| Returns ||
|---|---|
| `int` | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either `0` or - `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` |

### getResultCode

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getResultCode ()
```

Returns the result code indicating status of the request.

<br />

| Returns ||
|---|---|
| `int` | Value is one of the following: - `https://developer.android.com/reference/android/service/settings/preferences/SetValueResult#RESULT_OK` - `https://developer.android.com/reference/android/service/settings/preferences/SetValueResult#RESULT_UNSUPPORTED` - `https://developer.android.com/reference/android/service/settings/preferences/SetValueResult#RESULT_DISABLED` - `https://developer.android.com/reference/android/service/settings/preferences/SetValueResult#RESULT_RESTRICTED` - `https://developer.android.com/reference/android/service/settings/preferences/SetValueResult#RESULT_UNAVAILABLE` - `https://developer.android.com/reference/android/service/settings/preferences/SetValueResult#RESULT_REQUIRE_APP_PERMISSION` - `https://developer.android.com/reference/android/service/settings/preferences/SetValueResult#RESULT_REQUIRE_USER_CONSENT` - `https://developer.android.com/reference/android/service/settings/preferences/SetValueResult#RESULT_DISALLOW` - `https://developer.android.com/reference/android/service/settings/preferences/SetValueResult#RESULT_INVALID_REQUEST` - `https://developer.android.com/reference/android/service/settings/preferences/SetValueResult#RESULT_INTERNAL_ERROR` |

### writeToParcel

Added in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeToParcel (Parcel dest, 
                int flags)
```

Flatten this object in to a Parcel.

<br />

| Parameters ||
|---|---|
| `dest` | `Parcel`: The Parcel in which the object should be written. This value cannot be `null`. <br /> |
| `flags` | `int`: Additional flags about how the object should be written. May be 0 or `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE`. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE` |