# ChannelLogoUtils

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  
belongs to Maven artifact com.android.support:support-tv-provider:28.0.0-alpha1  
Summary:[Ctors](https://developer.android.com/reference/android/support/media/tv/ChannelLogoUtils#pubctors)\|[Methods](https://developer.android.com/reference/android/support/media/tv/ChannelLogoUtils#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/media/tv/ChannelLogoUtils#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/media/tv/ChannelLogoUtils#)  

# ChannelLogoUtils

| This package is part of the Android[support library](https://developer.android.com/topic/libraries/support-library)which is no longer maintained. The support library has been superseded by[AndroidX](https://developer.android.com/jetpack/androidx)which is part of[Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider[migrating](https://developer.android.com/jetpack/androidx/migrate)existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library[class mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).

`
public


class
ChannelLogoUtils
`  
`

extends Object


``


`

|---|-------------------------------------------|
| java.lang.Object                             ||
| ↳ | android.support.media.tv.ChannelLogoUtils |

<br />

*** ** * ** ***

A utility class for conveniently storing and loading channel logos.

## Summary

|                                                       ### Public constructors                                                       ||
|----------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[ChannelLogoUtils](https://developer.android.com/reference/android/support/media/tv/ChannelLogoUtils#ChannelLogoUtils())`() ` |

|                                                                                                                                                                                                                                                                                                                           ### Public methods                                                                                                                                                                                                                                                                                                                           ||
|------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` static `[Bitmap](https://developer.android.com/reference/android/graphics/Bitmap.html) | ` `[loadChannelLogo](https://developer.android.com/reference/android/support/media/tv/ChannelLogoUtils#loadChannelLogo(android.content.Context, long))`(`[Context](https://developer.android.com/reference/android/content/Context.html)` context, long channelId) ` A convenient helper method to get the channel logo associated to the given channel ID from the system content provider.                                                                                                                                                                                 |
| ` static boolean`                                                                        | ` `[storeChannelLogo](https://developer.android.com/reference/android/support/media/tv/ChannelLogoUtils#storeChannelLogo(android.content.Context, long, android.graphics.Bitmap))`(`[Context](https://developer.android.com/reference/android/content/Context.html)` context, long channelId, `[Bitmap](https://developer.android.com/reference/android/graphics/Bitmap.html)` logo) ` Stores the given channel logo[Bitmap](https://developer.android.com/reference/android/graphics/Bitmap.html)in the system content provider and associate it with the given channel ID. |
| ` static boolean`                                                                        | ` `[storeChannelLogo](https://developer.android.com/reference/android/support/media/tv/ChannelLogoUtils#storeChannelLogo(android.content.Context, long, android.net.Uri))`(`[Context](https://developer.android.com/reference/android/content/Context.html)` context, long channelId, `[Uri](https://developer.android.com/reference/android/net/Uri.html)` logoUri) ` Stores channel logo in the system content provider from the given URI.                                                                                                                                |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/media/tv/ChannelLogoUtils#)From class` java.lang.Object ` |-------------------|-------------------------------| | ` Object`         | ` clone() `                   | | ` boolean`        | ` equals(Object arg0) `       | | ` void`           | ` finalize() `                | | ` final Class<?>` | ` getClass() `                | | ` int`            | ` hashCode() `                | | ` final void`     | ` notify() `                  | | ` final void`     | ` notifyAll() `               | | ` String`         | ` toString() `                | | ` final void`     | ` wait(long arg0, int arg1) ` | | ` final void`     | ` wait(long arg0) `           | | ` final void`     | ` wait() `                    | ||

## Public constructors

### ChannelLogoUtils

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
ChannelLogoUtils ()
```

<br />

<br />

## Public methods

### loadChannelLogo

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Bitmap loadChannelLogo (Context context, 
                long channelId)
```

A convenient helper method to get the channel logo associated to the given channel ID from the system content provider.

<br />

|                                      Parameters                                       ||
|-------------|--------------------------------------------------------------------------|
| `context`   | `Context`: the context used to access the system content provider <br /> |
| `channelId` | `long`: the ID of the channel whose logo is supposed to be loaded <br /> |

|                                                                                                            Returns                                                                                                            ||
|--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------|
| [Bitmap](https://developer.android.com/reference/android/graphics/Bitmap.html) | the requested channel logo in[Bitmap](https://developer.android.com/reference/android/graphics/Bitmap.html), or`null`if not available. <br /> |

**See also:**

- [storeChannelLogo(Context, long, Uri)](https://developer.android.com/reference/android/support/media/tv/ChannelLogoUtils#storeChannelLogo(android.content.Context, long, android.net.Uri))
- [storeChannelLogo(Context, long, Bitmap)](https://developer.android.com/reference/android/support/media/tv/ChannelLogoUtils#storeChannelLogo(android.content.Context, long, android.graphics.Bitmap))  

### storeChannelLogo

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean storeChannelLogo (Context context, 
                long channelId, 
                Bitmap logo)
```

Stores the given channel logo[Bitmap](https://developer.android.com/reference/android/graphics/Bitmap.html)in the system content provider and associate it with the given channel ID.

<br />

|                                               Parameters                                                ||
|-------------|--------------------------------------------------------------------------------------------|
| `context`   | `Context`: the context used to access the system content provider <br />                   |
| `channelId` | `long`: the ID of the target channel with which the given logo should be associated <br /> |
| `logo`      | `Bitmap`: the logo image to be stored <br />                                               |

|                                                  Returns                                                  ||
|-----------|------------------------------------------------------------------------------------------------|
| `boolean` | `true`if successfully stored the logo in the system content provider, otherwise`false`. <br /> |

**See also:**

- [loadChannelLogo(Context, long)](https://developer.android.com/reference/android/support/media/tv/ChannelLogoUtils#loadChannelLogo(android.content.Context, long))  

### storeChannelLogo

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean storeChannelLogo (Context context, 
                long channelId, 
                Uri logoUri)
```

Stores channel logo in the system content provider from the given URI. The method will try to fetch the image file and decode it into[Bitmap](https://developer.android.com/reference/android/graphics/Bitmap.html). Once the image is successfully fetched, it will be stored in the system content provider and associated with the given channel ID.

The URI provided to this method can be a URL referring to a image file residing in some remote site/server, or a URI in one of the following formats:

- content ([SCHEME_CONTENT](https://developer.android.com/reference/android/content/ContentResolver.html#SCHEME_CONTENT))
- android.resource ([#SCHEME_ANDROID_RESOURCE](https://developer.android.com/reference/android/content/ContentResolver.html))
- file ([SCHEME_FILE](https://developer.android.com/reference/android/content/ContentResolver.html#SCHEME_FILE))

This method should be run in a worker thread since it may require network connection, which will raise an exception if it's running in the main thread.

<br />

|                                                                            Parameters                                                                             ||
|-------------|------------------------------------------------------------------------------------------------------------------------------------------------------|
| `context`   | `Context`: the context used to access the system content provider <br />                                                                             |
| `channelId` | `long`: the ID of the target channel with which the fetched logo should be associated <br />                                                         |
| `logoUri`   | `Uri`: the[Uri](https://developer.android.com/reference/android/net/Uri.html)of the logo file to be fetched and stored in the system provider <br /> |

|                                                                            Returns                                                                             ||
|-----------|-----------------------------------------------------------------------------------------------------------------------------------------------------|
| `boolean` | `true`if successfully fetched the image file referred by the give logo URI and stored it in the system content provider, or`false`if failed. <br /> |

**See also:**

- [loadChannelLogo(Context, long)](https://developer.android.com/reference/android/support/media/tv/ChannelLogoUtils#loadChannelLogo(android.content.Context, long))  
-

  ## Interfaces

  - [TvContractCompat.BaseTvColumns](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.BaseTvColumns)
-

  ## Classes

  - [Channel](https://developer.android.com/reference/android/support/media/tv/Channel)
  - [Channel.Builder](https://developer.android.com/reference/android/support/media/tv/Channel.Builder)
  - [ChannelLogoUtils](https://developer.android.com/reference/android/support/media/tv/ChannelLogoUtils)
  - [PreviewProgram](https://developer.android.com/reference/android/support/media/tv/PreviewProgram)
  - [PreviewProgram.Builder](https://developer.android.com/reference/android/support/media/tv/PreviewProgram.Builder)
  - [Program](https://developer.android.com/reference/android/support/media/tv/Program)
  - [Program.Builder](https://developer.android.com/reference/android/support/media/tv/Program.Builder)
  - [R](https://developer.android.com/reference/android/support/media/tv/R)
  - [R.attr](https://developer.android.com/reference/android/support/media/tv/R.attr)
  - [R.bool](https://developer.android.com/reference/android/support/media/tv/R.bool)
  - [R.color](https://developer.android.com/reference/android/support/media/tv/R.color)
  - [R.dimen](https://developer.android.com/reference/android/support/media/tv/R.dimen)
  - [R.drawable](https://developer.android.com/reference/android/support/media/tv/R.drawable)
  - [R.id](https://developer.android.com/reference/android/support/media/tv/R.id)
  - [R.integer](https://developer.android.com/reference/android/support/media/tv/R.integer)
  - [R.layout](https://developer.android.com/reference/android/support/media/tv/R.layout)
  - [R.string](https://developer.android.com/reference/android/support/media/tv/R.string)
  - [R.style](https://developer.android.com/reference/android/support/media/tv/R.style)
  - [R.styleable](https://developer.android.com/reference/android/support/media/tv/R.styleable)
  - [TvContractCompat](https://developer.android.com/reference/android/support/media/tv/TvContractCompat)
  - [TvContractCompat.Channels](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Channels)
  - [TvContractCompat.Channels.Logo](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Channels.Logo)
  - [TvContractCompat.PreviewPrograms](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.PreviewPrograms)
  - [TvContractCompat.Programs](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Programs)
  - [TvContractCompat.Programs.Genres](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.Programs.Genres)
  - [TvContractCompat.RecordedPrograms](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.RecordedPrograms)
  - [TvContractCompat.WatchNextPrograms](https://developer.android.com/reference/android/support/media/tv/TvContractCompat.WatchNextPrograms)
  - [WatchNextProgram](https://developer.android.com/reference/android/support/media/tv/WatchNextProgram)
  - [WatchNextProgram.Builder](https://developer.android.com/reference/android/support/media/tv/WatchNextProgram.Builder)