InputCallback

public interface InputCallback

androidx.car.app.model.InputCallback


A listener for handling text input completion event.

Summary

Public methods

default void onInputSubmitted(String text)

Notifies when the user finished entering text in an input box.

default void onInputTextChanged(String text)

Notifies the current text has changed in an input box.

Public methods

onInputSubmitted

public void onInputSubmitted (String text)

Notifies when the user finished entering text in an input box.

This event is sent when the user finishes typing in the keyboard and pressed enter. If the user simply stops typing and closes the keyboard, this event will not be sent.

Parameters
text String: the text that was entered, or an empty string if no text was typed.

onInputTextChanged

public void onInputTextChanged (String text)

Notifies the current text has changed in an input box.

The host may invoke this callback as the user types an input text. The frequency of these updates is not guaranteed to be after every individual keystroke. The host may decide to wait for several keystrokes before sending a single update.

Parameters
text String: the current text that the user has typed