Skip to content

Instantly share code, notes, and snippets.

@ademirqueiroga
Created February 22, 2023 15:49
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Creating/Updating channels
val existingChannel = queryChannels().firstOrNull {
it.internalProviderId == category.id.toString()
}
val channelBuilder = when (existingChannel) {
null -> Channel.Builder()
else -> Channel.Builder(existingChannel)
}
val channel = channelBuilder
.setType(TvContractCompat.Channels.TYPE_PREVIEW)
.setDisplayName(category.title)
.setInternalProviderId(category.id.toString())
.setAppLinkIntentUri("content://channelsample.com/category/${category.id}".toUri())
.build()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment