Browse SDKs · Android
Platform
SDKsAndroid

Retrieve typing status

Use getInputState to retrieve a specified user’s current typing status in a conversation.

Copy

Query whether a specific user is currently typing in a conversation. The SDK returns a list of platform IDs where the user is actively typing, allowing you to calibrate the typing indicator when entering a chat or recovering from a network disconnection.

Code example

String conversationID = "si_user_a_user_b";
String userID = "user_b";

OpenIMClient.getInstance().conversationManager.getInputState(
    new OnBase<List<Integer>>() {
        @Override
        public void onSuccess(List<Integer> platformIDs) {
            boolean isTyping = platformIDs != null && !platformIDs.isEmpty();
            // isTyping indicates whether the user is actively typing
        }

        @Override
        public void onError(int code, String error) {
            // Failed to query typing status
        }
    },
    conversationID,
    userID
);

Parameters

ParameterTypeRequiredDescription
baseOnBase<List<Integer>>YesCallback handler for the asynchronous request.
conversationIDStringYesGlobally unique ID of the target conversation.
userIDStringYesUser ID of the target user to check.

Return value

Upon success, onSuccess returns a list of platform IDs (List<Integer>) where the user is currently typing.

  • A non-empty list indicates the user is actively typing on at least one client device.
  • An empty or null list indicates the user is not actively typing.

For real-time typing indicators and listeners, see Update typing status.