# Print output for @column tags ?> BooleanAction - Android SDK | Android Developers

Most visited

Recently visited

BooleanAction

public final class BooleanAction
extends ControlAction

java.lang.Object
   ↳ android.service.controls.actions.ControlAction
     ↳ android.service.controls.actions.BooleanAction


Action sent by user toggling a Control between checked/unchecked. This action is available when the Control was constructed with either a ToggleTemplate or a ToggleRangeTemplate.

Summary

Inherited constants

Public constructors

BooleanAction(String templateId, boolean newState)
BooleanAction(String templateId, boolean newState, String challengeValue)

Public methods

int getActionType()

The ActionType associated with this class.

boolean getNewState()

The new state set for the button in the corresponding ToggleTemplate.

Inherited methods

Public constructors

BooleanAction

public BooleanAction (String templateId, 
                boolean newState)

Parameters
templateId String: the identifier of the ToggleTemplate that produced this action. This value cannot be null.

newState boolean: new value for the state displayed by the ToggleTemplate.

BooleanAction

public BooleanAction (String templateId, 
                boolean newState, 
                String challengeValue)

Parameters
templateId String: the identifier of the template that originated this action. This value cannot be null.

newState boolean: new value for the state displayed by the template.

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. This value may be null.

Public methods

getActionType

public int getActionType ()

The ActionType associated with this class.

Returns
int ControlAction#TYPE_BOOLEAN

getNewState

public boolean getNewState ()

The new state set for the button in the corresponding ToggleTemplate.

Returns
boolean true if the button was toggled from unchecked to checked.