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

Retrieve a poll

Copy link

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

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

    // The poll is successfully retrieved.
}

PollRetrievalParams

Copy link
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

Copy link

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

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