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.

Retrieve a poll

You can retrieve a specific poll by creating and passing a PollRetrievalParams object as an argument to the get() method.

val params = PollRetrievalParams(pollId, channel.channelType, channel.url)
Poll.get(params) { poll, e ->
    if (e != null) {
        // Handle error.
    }

    // The poll is successfully retrieved.
}

PollRetrievalParams

Parameter nameTypeDescription

channelUrl

string

Specifies the URL of the channel.

channelType

channelType

Specifies the type of the channel.

pollId

long

Specifies the unique ID of a poll.

PollHandler

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

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