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

Add a poll option

Copy link

You can add a poll option to an existing poll by passing the pollId and the optionText as an argument to the parameter in the addPollOption() method.

channel.addPollOption(pollId, "optionText") { poll, e ->
    if (e != null) {
        // Handle error.
    }
    
    if (poll != null) {
        
    }
}

PollHandler

Copy link

Through PollHandler, the Sendbird server always notifies whether your poll option has been successfully added.

fun interface PollHandler {
    fun onResult(poll: Poll?, e: SendbirdException?)
}