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

Most visited


Recently visited


ToggleTemplate

public final class ToggleTemplate
extends ControlTemplate

java.lang.Object
   ↳ android.service.controls.templates.ControlTemplate
     ↳ android.service.controls.templates.ToggleTemplate


A template for a Control with a single button that can be toggled between two states. The states for the toggle correspond to the states in ControlButton#isChecked(). An action on this template will originate a BooleanAction to change that state.

See also:

Summary


Inherited constants

Public constructors

ToggleTemplate(String templateId, ControlButton button)

Public methods

CharSequence getContentDescription()
int getTemplateType()

The TemplateType associated with this class.

boolean isChecked()

Inherited methods

Public constructors


ToggleTemplate

public ToggleTemplate (String templateId, 
                ControlButton button)

Parameters
templateId String: the identifier for this template object This value cannot be null.

button ControlButton: a ControlButton that can show the current state and toggle it This value cannot be null.

Public methods


getContentDescription

public CharSequence getContentDescription ()

Returns
CharSequence This value cannot be null.

getTemplateType

public int getTemplateType ()

The TemplateType associated with this class.

Returns
int ControlTemplate#TYPE_TOGGLE

isChecked

public boolean isChecked ()

Returns
boolean

Browse this site in English?

You requested a page in English, but your language preference for this site is English.

Would you like to change your language preference and browse this site in English? If you want to change your language preference later, use the language menu at the bottom of each page.