Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Inherited Constants](https://developer.android.com/reference/android/service/controls/actions/FloatAction#inhconstants) \| [Ctors](https://developer.android.com/reference/android/service/controls/actions/FloatAction#pubctors) \| [Methods](https://developer.android.com/reference/android/service/controls/actions/FloatAction#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/service/controls/actions/FloatAction#inhmethods)

# FloatAction

*** ** * ** ***

` public final class FloatAction `   
` ` ` extends https://developer.android.com/reference/android/service/controls/actions/ControlAction ` ` `

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) |||
| ↳ | [android.service.controls.actions.ControlAction](https://developer.android.com/reference/android/service/controls/actions/ControlAction) ||
|   | ↳ | android.service.controls.actions.FloatAction |

<br />

*** ** * ** ***

Action sent by a `https://developer.android.com/reference/android/service/controls/templates/RangeTemplate`, `https://developer.android.com/reference/android/service/controls/templates/ToggleRangeTemplate`.

## Summary

### Inherited constants

From class `https://developer.android.com/reference/android/service/controls/actions/ControlAction` `int` `https://developer.android.com/reference/android/service/controls/actions/ControlAction#RESPONSE_CHALLENGE_ACK`

Response code for the `consumer` in `https://developer.android.com/reference/android/service/controls/ControlsProviderService#performControlAction(java.lang.String,%20android.service.controls.actions.ControlAction,%20java.util.function.Consumer<java.lang.Integer>)` indicating that in order for the action to be performed, acknowledgment from the user is required.
`int` `https://developer.android.com/reference/android/service/controls/actions/ControlAction#RESPONSE_CHALLENGE_PASSPHRASE`

Response code for the `consumer` in `https://developer.android.com/reference/android/service/controls/ControlsProviderService#performControlAction(java.lang.String,%20android.service.controls.actions.ControlAction,%20java.util.function.Consumer<java.lang.Integer>)` indicating that in order for the action to be performed, an alphanumeric passphrase is required.
`int` `https://developer.android.com/reference/android/service/controls/actions/ControlAction#RESPONSE_CHALLENGE_PIN`

Response code for the `consumer` in `https://developer.android.com/reference/android/service/controls/ControlsProviderService#performControlAction(java.lang.String,%20android.service.controls.actions.ControlAction,%20java.util.function.Consumer<java.lang.Integer>)` indicating that in order for the action to be performed, a PIN is required.
`int` `https://developer.android.com/reference/android/service/controls/actions/ControlAction#RESPONSE_FAIL`

Response code for the `consumer` in `https://developer.android.com/reference/android/service/controls/ControlsProviderService#performControlAction(java.lang.String,%20android.service.controls.actions.ControlAction,%20java.util.function.Consumer<java.lang.Integer>)` indicating that the action has failed.
`int` `https://developer.android.com/reference/android/service/controls/actions/ControlAction#RESPONSE_OK`

Response code for the `consumer` in `https://developer.android.com/reference/android/service/controls/ControlsProviderService#performControlAction(java.lang.String,%20android.service.controls.actions.ControlAction,%20java.util.function.Consumer<java.lang.Integer>)` indicating that the action has been performed.
`int` `https://developer.android.com/reference/android/service/controls/actions/ControlAction#RESPONSE_UNKNOWN`

Value is one of the following:

- `https://developer.android.com/reference/android/service/controls/actions/ControlAction#RESPONSE_UNKNOWN`
- `https://developer.android.com/reference/android/service/controls/actions/ControlAction#RESPONSE_OK`
- `https://developer.android.com/reference/android/service/controls/actions/ControlAction#RESPONSE_FAIL`
- `https://developer.android.com/reference/android/service/controls/actions/ControlAction#RESPONSE_CHALLENGE_ACK`
- `https://developer.android.com/reference/android/service/controls/actions/ControlAction#RESPONSE_CHALLENGE_PIN`
- `https://developer.android.com/reference/android/service/controls/actions/ControlAction#RESPONSE_CHALLENGE_PASSPHRASE`
`int` `https://developer.android.com/reference/android/service/controls/actions/ControlAction#TYPE_BOOLEAN`

The identifier of `https://developer.android.com/reference/android/service/controls/actions/BooleanAction`.
`int` `https://developer.android.com/reference/android/service/controls/actions/ControlAction#TYPE_COMMAND`

The identifier of `https://developer.android.com/reference/android/service/controls/actions/CommandAction`.
`int` `https://developer.android.com/reference/android/service/controls/actions/ControlAction#TYPE_ERROR`

The identifier of the action returned by `https://developer.android.com/reference/android/service/controls/actions/ControlAction#getErrorAction()`.
`int` `https://developer.android.com/reference/android/service/controls/actions/ControlAction#TYPE_FLOAT`

The identifier of `https://developer.android.com/reference/android/service/controls/actions/FloatAction`.
`int` `https://developer.android.com/reference/android/service/controls/actions/ControlAction#TYPE_MODE`

The identifier of `https://developer.android.com/reference/android/service/controls/actions/ModeAction`.

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/service/controls/actions/FloatAction#FloatAction(java.lang.String,%20float)(https://developer.android.com/reference/java/lang/String templateId, float newValue) ` |
| ` https://developer.android.com/reference/android/service/controls/actions/FloatAction#FloatAction(java.lang.String,%20float,%20java.lang.String)(https://developer.android.com/reference/java/lang/String templateId, float newValue, https://developer.android.com/reference/java/lang/String challengeValue) ` |

| ### Public methods ||
|---|---|
| ` int` | ` https://developer.android.com/reference/android/service/controls/actions/FloatAction#getActionType()() ` The action type associated with this class. |
| ` float` | ` https://developer.android.com/reference/android/service/controls/actions/FloatAction#getNewValue()() ` The new value set for the range in the corresponding `https://developer.android.com/reference/android/service/controls/templates/RangeTemplate`. |

### Inherited methods

From class ` https://developer.android.com/reference/android/service/controls/actions/ControlAction ` ` abstract int` ` https://developer.android.com/reference/android/service/controls/actions/ControlAction#getActionType()() `

The action type associated with this class.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/android/service/controls/actions/ControlAction#getChallengeValue()() `

The challenge value used to authenticate certain actions, if available.
` static https://developer.android.com/reference/android/service/controls/actions/ControlAction` ` https://developer.android.com/reference/android/service/controls/actions/ControlAction#getErrorAction()() `

Returns a singleton `https://developer.android.com/reference/android/service/controls/actions/ControlAction` used for indicating an error in unparceling.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/android/service/controls/actions/ControlAction#getTemplateId()() `

The identifier of the `https://developer.android.com/reference/android/service/controls/templates/ControlTemplate` that originated this action
` static final boolean` ` https://developer.android.com/reference/android/service/controls/actions/ControlAction#isValidResponse(int)(int response) ` 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*.

## Public constructors

### FloatAction

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

```
public FloatAction (String templateId, 
                float newValue)
```

<br />

<br />

| Parameters ||
|---|---|
| `templateId` | `String`: the identifier of the `https://developer.android.com/reference/android/service/controls/templates/RangeTemplate` that produced this action. This value cannot be `null`. <br /> |
| `newValue` | `float`: new value for the state displayed by the `https://developer.android.com/reference/android/service/controls/templates/RangeTemplate`. <br /> |

### FloatAction

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

```
public FloatAction (String templateId, 
                float newValue, 
                String challengeValue)
```

<br />

<br />

| Parameters ||
|---|---|
| `templateId` | `String`: the identifier of the `https://developer.android.com/reference/android/service/controls/templates/RangeTemplate` that originated this action. This value cannot be `null`. <br /> |
| `newValue` | `float`: new value for the state of the `https://developer.android.com/reference/android/service/controls/templates/RangeTemplate`. <br /> |
| `challengeValue` | `String`: a value sent by the user along with the action to authenticate. null is sent when no authentication is needed or has not been requested. <br /> |

## Public methods

### getActionType

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

```
public int getActionType ()
```

The action type associated with this class.

<br />

| Returns ||
|---|---|
| `int` | `https://developer.android.com/reference/android/service/controls/actions/ControlAction#TYPE_FLOAT` <br /> |

### getNewValue

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

```
public float getNewValue ()
```

The new value set for the range in the corresponding `https://developer.android.com/reference/android/service/controls/templates/RangeTemplate`.

<br />

| Returns ||
|---|---|
| `float` | <br /> |