# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Ctors | Methods | Inherited Methods

# AlwaysOnHotwordDetector.Callback

`public static abstract class AlwaysOnHotwordDetector.Callback`
`extends Object` ``

java.lang.Object
↳ | android.service.voice.AlwaysOnHotwordDetector.Callback

Callbacks for always-on hotword detection.

## Summary

### Public constructors
`Callback()`

### Public methods
`abstract void` | `onAvailabilityChanged(int status)` Called when the hotword availability changes.
`abstract void` | `onDetected(AlwaysOnHotwordDetector.EventPayload eventPayload)` Called when the keyphrase is spoken.
`abstract void` | `onError()` Called when the detection fails due to an error.
`abstract void` | `onRecognitionPaused()` Called when the recognition is paused temporarily for some reason.
`abstract void` | `onRecognitionResumed()` Called when the recognition is resumed after it was temporarily paused.

### Inherited methods
From class `java.lang.Object`
`Object` | `clone()` Creates and returns a copy of this object.
`boolean` | `equals(Object obj)` Indicates whether some other object is "equal to" this one.
`void` | `finalize()` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
`final Class<?>` | `getClass()` Returns the runtime class of this `Object`.
`int` | `hashCode()` Returns a hash code value for the object.
`final void` | `notify()` Wakes up a single thread that is waiting on this object's monitor.
`final void` | `notifyAll()` Wakes up all threads that are waiting on this object's monitor.
`String` | `toString()` Returns a string representation of the object.
`final void` | `wait(long timeout, int nanos)` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
`final void` | `wait(long timeout)` Causes the current thread to wait until either another thread invokes the `notify()` method or the `notifyAll()` method for this object, or a specified amount of time has elapsed.
`final void` | `wait()` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object.

## Public constructors

### Callback

    public Callback ()

## Public methods

### onAvailabilityChanged

    public abstract void onAvailabilityChanged (int status)

Called when the hotword availability changes. This indicates a change in the availability of recognition for the given keyphrase. It's called at least once with the initial availability.

Availability implies whether the hardware on this system is capable of listening for the given keyphrase or not.

Parameters
`status` | `int`

See also:

- `AlwaysOnHotwordDetector.STATE_HARDWARE_UNAVAILABLE`
- `AlwaysOnHotwordDetector.STATE_KEYPHRASE_UNSUPPORTED`
- `AlwaysOnHotwordDetector.STATE_KEYPHRASE_UNENROLLED`
- `AlwaysOnHotwordDetector.STATE_KEYPHRASE_ENROLLED`

### onDetected

    public abstract void onDetected (AlwaysOnHotwordDetector.EventPayload eventPayload)

Called when the keyphrase is spoken. This implicitly stops listening for the keyphrase once it's detected. Clients should start a recognition again once they are done handling this detection.

Parameters
`eventPayload` | `AlwaysOnHotwordDetector.EventPayload`: Payload data for the detection event. This may contain the trigger audio, if requested when calling `AlwaysOnHotwordDetector#startRecognition(int)`. This value cannot be `null`.

### onError

    public abstract void onError ()

Called when the detection fails due to an error.

### onRecognitionPaused

    public abstract void onRecognitionPaused ()

Called when the recognition is paused temporarily for some reason. This is an informational callback, and the clients shouldn't be doing anything here except showing an indication on their UI if they have to.

### onRecognitionResumed

    public abstract void onRecognitionResumed ()

Called when the recognition is resumed after it was temporarily paused. This is an informational callback, and the clients shouldn't be doing anything here except showing an indication on their UI if they have to.

Full name *
Email address *
Company / developer name
One of your Play Store app URLs *
Which best describes your business:*
Apps
Games
Apps & Games
*
*