Chat / Android
Chat Android v4
Chat Android
Chat
Android
Home
/
Chat
/
Android
/
Message
This is the new Docs for Chat SDK v4 for Android. To see the previous Docs, click here.

Send typing indicators to other members

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.
                // ...
            }
        }
    }
)