/ SDKs / Android
SDKs
Chat SDKs Android v4
Chat SDKs Android
Chat SDKs
Android
Version 4

Send typing indicators to other members

Copy link

If the startTyping() and endTyping() methods are called while the current user is typing a message in a group channel, onTypingStatusUpdated() in the channel event handler will be invoked on all channel members' devices except the one that belongs to the current user.

groupChannel.startTyping();
groupChannel.endTyping();
// ...

// To listen to an update from all the other channel members' client apps,
// implement onTypingStatusUpdated() with things to do when notified.
SendbirdChat.addChannelHandler(
    UNIQUE_HANDLER_ID,
    object : GroupChannelHandler() {
        override fun onTypingStatusUpdated(channel: GroupChannel) {
            if (currentGroupChannel.url == channel.url) {
                val members = channel.typingUsers

                // Refresh typing status of members within the channel.
                // ...
            }
        }
    }
)