다음을 통해 공유


AlwaysOnHotwordDetector.CreateEnrollIntent Method

Definition

Creates an intent to start the enrollment for the associated keyphrase.

[Android.Runtime.Register("createEnrollIntent", "()Landroid/content/Intent;", "GetCreateEnrollIntentHandler")]
public virtual Android.Content.Intent? CreateEnrollIntent ();
[<Android.Runtime.Register("createEnrollIntent", "()Landroid/content/Intent;", "GetCreateEnrollIntentHandler")>]
abstract member CreateEnrollIntent : unit -> Android.Content.Intent
override this.CreateEnrollIntent : unit -> Android.Content.Intent

Returns

An Intent to start enrollment for the given keyphrase.

Attributes

Exceptions

if managing they keyphrase isn't supported. Callers should only call this method after a supported state callback on AlwaysOnHotwordDetector Callback onAvailabilityChanged(int) to avoid this exception.

if the detector is in an invalid state. This may happen if another detector has been instantiated or the VoiceInteractionService hosting this detector has been shut down.

Remarks

Creates an intent to start the enrollment for the associated keyphrase. This intent must be invoked using Context#startForegroundService(Intent). Starting re-enrollment is only valid if the keyphrase is un-enrolled, i.e. #STATE_KEYPHRASE_UNENROLLED, otherwise #createReEnrollIntent() should be preferred.

Java documentation for android.service.voice.AlwaysOnHotwordDetector.createEnrollIntent().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to