Share via


VoiceInteractionSession.StartVoiceActivity(Intent) Method

Definition

Ask that a new activity be started for voice interaction.

[Android.Runtime.Register("startVoiceActivity", "(Landroid/content/Intent;)V", "GetStartVoiceActivity_Landroid_content_Intent_Handler", ApiSince=23)]
public virtual void StartVoiceActivity (Android.Content.Intent? intent);
[<Android.Runtime.Register("startVoiceActivity", "(Landroid/content/Intent;)V", "GetStartVoiceActivity_Landroid_content_Intent_Handler", ApiSince=23)>]
abstract member StartVoiceActivity : Android.Content.Intent -> unit
override this.StartVoiceActivity : Android.Content.Intent -> unit

Parameters

intent
Intent

The Intent to start this voice interaction. The given Intent will always have Intent#CATEGORY_VOICE Intent.CATEGORY_VOICE added to it, since this is part of a voice interaction.

Attributes

Remarks

Ask that a new activity be started for voice interaction. This will create a new dedicated task in the activity manager for this voice interaction session; this means that Intent#FLAG_ACTIVITY_NEW_TASK Intent.FLAG_ACTIVITY_NEW_TASK will be set for you to make it a new task.

The newly started activity will be displayed to the user in a special way, as a layer under the voice interaction UI.

As the voice activity runs, it can retrieve a android.app.VoiceInteractor through which it can perform voice interactions through your session. These requests for voice interactions will appear as callbacks on #onGetSupportedCommands, #onRequestConfirmation, #onRequestPickOption, #onRequestCompleteVoice, #onRequestAbortVoice, or #onRequestCommand

You will receive a call to #onTaskStarted when the task starts up and #onTaskFinished when the last activity has finished.

Java documentation for android.service.voice.VoiceInteractionSession.startVoiceActivity(android.content.Intent).

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