Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Deprecated in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# Thumbnails

*** ** * ** ***

Kotlin \|[Java](https://developer.android.com/reference/android/provider/MediaStore.Video.Thumbnails "View this page in Java")

```
class Thumbnails : BaseColumns
```

|---|---|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||
| ↳ | [android.provider.MediaStore.Video.Thumbnails](https://developer.android.com/reference/kotlin/android/provider/MediaStore.Video.Thumbnails#) |

*** ** * ** ***

| **This class was deprecated in API level 29.**
|
| Callers should migrate to using `https://developer.android.com/reference/kotlin/android/content/ContentResolver.html#loadThumbnail(android.net.Uri,%20android.util.Size,%20android.os.CancellationSignal)`, since it offers richer control over requested thumbnail sizes and cancellation behavior.

This class provides utility methods to obtain thumbnails for various `https://developer.android.com/reference/kotlin/android/provider/MediaStore.Video` items.

## Summary

| Constants ||
|---|---|
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `https://developer.android.com/reference/kotlin/android/provider/MediaStore.Video.Thumbnails#DATA:kotlin.String` Path to the thumbnail file on disk. |
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `https://developer.android.com/reference/kotlin/android/provider/MediaStore.Video.Thumbnails#DEFAULT_SORT_ORDER:kotlin.String` The default sort order for this table |
| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/provider/MediaStore.Video.Thumbnails#FULL_SCREEN_KIND:kotlin.Int` <br /> |
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `https://developer.android.com/reference/kotlin/android/provider/MediaStore.Video.Thumbnails#HEIGHT:kotlin.String` The height of the thumbnail. |
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `https://developer.android.com/reference/kotlin/android/provider/MediaStore.Video.Thumbnails#KIND:kotlin.String` The kind of the thumbnail. |
| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/provider/MediaStore.Video.Thumbnails#MICRO_KIND:kotlin.Int` <br /> |
| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/provider/MediaStore.Video.Thumbnails#MINI_KIND:kotlin.Int` <br /> |
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `https://developer.android.com/reference/kotlin/android/provider/MediaStore.Video.Thumbnails#VIDEO_ID:kotlin.String` The original image for the thumbnal. |
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `https://developer.android.com/reference/kotlin/android/provider/MediaStore.Video.Thumbnails#WIDTH:kotlin.String` The width of the thumbnal. |

| Inherited constants ||
|---|---|
| From class `https://developer.android.com/reference/kotlin/android/provider/BaseColumns` |---|---| | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/android/provider/BaseColumns#_COUNT:kotlin.String` The count of rows in a directory. Type: INTEGER <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/android/provider/BaseColumns#_ID:kotlin.String` The unique ID for a row. Type: INTEGER (long) <br /> | ||

| Public constructors ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/provider/MediaStore.Video.Thumbnails#Thumbnails()()` <br /> |

| Public methods ||
|---|---|
| open static [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `https://developer.android.com/reference/kotlin/android/provider/MediaStore.Video.Thumbnails#cancelThumbnailRequest(android.content.ContentResolver,%20kotlin.Long)(cr: https://developer.android.com/reference/kotlin/android/content/ContentResolver.html#!, origId: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)` Cancel any outstanding #getThumbnail requests, causing them to return by throwing a `https://developer.android.com/reference/kotlin/android/os/OperationCanceledException.html#`. |
| open static [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `https://developer.android.com/reference/kotlin/android/provider/MediaStore.Video.Thumbnails#cancelThumbnailRequest(android.content.ContentResolver,%20kotlin.Long,%20kotlin.Long)(cr: https://developer.android.com/reference/kotlin/android/content/ContentResolver.html#!, videoId: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html, groupId: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)` Cancel any outstanding #getThumbnail requests, causing them to return by throwing a `https://developer.android.com/reference/kotlin/android/os/OperationCanceledException.html#`. |
| open static [Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)! | `https://developer.android.com/reference/kotlin/android/provider/MediaStore.Video.Thumbnails#getContentUri(kotlin.String)(volumeName: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html!)` Get the content:// style URI for the image media table on the given volume. |
| open static [Size](https://developer.android.com/reference/kotlin/android/util/Size.html#) | `https://developer.android.com/reference/kotlin/android/provider/MediaStore.Video.Thumbnails#getKindSize(kotlin.Int)(kind: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Return the typical `https://developer.android.com/reference/kotlin/android/util/Size.html#` (in pixels) used internally when the given thumbnail kind is requested. |
| open static [Bitmap](https://developer.android.com/reference/kotlin/android/graphics/Bitmap.html#)! | `https://developer.android.com/reference/kotlin/android/provider/MediaStore.Video.Thumbnails#getThumbnail(android.content.ContentResolver,%20kotlin.Long,%20kotlin.Int,%20android.graphics.BitmapFactory.Options)(cr: https://developer.android.com/reference/kotlin/android/content/ContentResolver.html#!, videoId: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html, kind: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html, options: https://developer.android.com/reference/kotlin/android/graphics/BitmapFactory.Options.html#!)` Return thumbnail representing a specific video item. |
| open static [Bitmap](https://developer.android.com/reference/kotlin/android/graphics/Bitmap.html#)! | `https://developer.android.com/reference/kotlin/android/provider/MediaStore.Video.Thumbnails#getThumbnail(android.content.ContentResolver,%20kotlin.Long,%20kotlin.Long,%20kotlin.Int,%20android.graphics.BitmapFactory.Options)(cr: https://developer.android.com/reference/kotlin/android/content/ContentResolver.html#!, videoId: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html, groupId: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html, kind: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html, options: https://developer.android.com/reference/kotlin/android/graphics/BitmapFactory.Options.html#!)` Return thumbnail representing a specific video item. |

| Properties ||
|---|---|
| static [Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)! | `https://developer.android.com/reference/kotlin/android/provider/MediaStore.Video.Thumbnails#EXTERNAL_CONTENT_URI:android.net.Uri` The content:// style URI for the "primary" external storage volume. |
| static [Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)! | `https://developer.android.com/reference/kotlin/android/provider/MediaStore.Video.Thumbnails#INTERNAL_CONTENT_URI:android.net.Uri` The content:// style URI for the internal storage. |

## Constants

### DATA

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
static val DATA: String
```

**Deprecated:** *Deprecated in Java.*

Path to the thumbnail file on disk.   
This constant represents a column name that can be used with a `https://developer.android.com/reference/kotlin/android/content/ContentProvider.html#` through a `https://developer.android.com/reference/kotlin/android/content/ContentValues.html#` or `https://developer.android.com/reference/kotlin/android/database/Cursor.html#` object. The values stored in this column are `https://developer.android.com/reference/kotlin/android/database/Cursor.html#FIELD_TYPE_STRING:kotlin.Int` .

    Value: "_data"

### DEFAULT_SORT_ORDER

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
static val DEFAULT_SORT_ORDER: String
```

**Deprecated:** *Deprecated in Java.*

The default sort order for this table

    Value: "video_id ASC"

### FULL_SCREEN_KIND

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
static val FULL_SCREEN_KIND: Int
```

**Deprecated:** *Deprecated in Java.*

    Value: 2

### HEIGHT

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
static val HEIGHT: String
```

**Deprecated:** *Deprecated in Java.*

The height of the thumbnail.   
This constant represents a column name that can be used with a `https://developer.android.com/reference/kotlin/android/content/ContentProvider.html#` through a `https://developer.android.com/reference/kotlin/android/content/ContentValues.html#` or `https://developer.android.com/reference/kotlin/android/database/Cursor.html#` object. The values stored in this column are `https://developer.android.com/reference/kotlin/android/database/Cursor.html#FIELD_TYPE_INTEGER:kotlin.Int` , and are read-only and cannot be mutated.

    Value: "height"

### KIND

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
static val KIND: String
```

**Deprecated:** *Deprecated in Java.*

The kind of the thumbnail.   
This constant represents a column name that can be used with a `https://developer.android.com/reference/kotlin/android/content/ContentProvider.html#` through a `https://developer.android.com/reference/kotlin/android/content/ContentValues.html#` or `https://developer.android.com/reference/kotlin/android/database/Cursor.html#` object. The values stored in this column are `https://developer.android.com/reference/kotlin/android/database/Cursor.html#FIELD_TYPE_INTEGER:kotlin.Int` .

    Value: "kind"

### MICRO_KIND

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
static val MICRO_KIND: Int
```

**Deprecated:** *Deprecated in Java.*

    Value: 3

### MINI_KIND

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
static val MINI_KIND: Int
```

**Deprecated:** *Deprecated in Java.*

    Value: 1

### VIDEO_ID

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
static val VIDEO_ID: String
```

**Deprecated:** *Deprecated in Java.*

The original image for the thumbnal.   
This constant represents a column name that can be used with a `https://developer.android.com/reference/kotlin/android/content/ContentProvider.html#` through a `https://developer.android.com/reference/kotlin/android/content/ContentValues.html#` or `https://developer.android.com/reference/kotlin/android/database/Cursor.html#` object. The values stored in this column are `https://developer.android.com/reference/kotlin/android/database/Cursor.html#FIELD_TYPE_INTEGER:kotlin.Int` .

    Value: "video_id"

### WIDTH

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
static val WIDTH: String
```

**Deprecated:** *Deprecated in Java.*

The width of the thumbnal.   
This constant represents a column name that can be used with a `https://developer.android.com/reference/kotlin/android/content/ContentProvider.html#` through a `https://developer.android.com/reference/kotlin/android/content/ContentValues.html#` or `https://developer.android.com/reference/kotlin/android/database/Cursor.html#` object. The values stored in this column are `https://developer.android.com/reference/kotlin/android/database/Cursor.html#FIELD_TYPE_INTEGER:kotlin.Int` , and are read-only and cannot be mutated.

    Value: "width"

## Public constructors

### Thumbnails

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
Thumbnails()
```

## Public methods

### cancelThumbnailRequest

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
open static fun cancelThumbnailRequest(
    cr: ContentResolver!, 
    origId: Long
): Unit
```

**Deprecated:** *Callers should migrate to using `https://developer.android.com/reference/kotlin/android/content/ContentResolver.html#loadThumbnail(android.net.Uri,%20android.util.Size,%20android.os.CancellationSignal)`, since it offers richer control over requested thumbnail sizes and cancellation behavior.*

Cancel any outstanding #getThumbnail requests, causing them to return by throwing a `https://developer.android.com/reference/kotlin/android/os/OperationCanceledException.html#`.

This method has no effect on `https://developer.android.com/reference/kotlin/android/content/ContentResolver.html#loadThumbnail(android.net.Uri,%20android.util.Size,%20android.os.CancellationSignal)` calls, since they provide their own `https://developer.android.com/reference/kotlin/android/os/CancellationSignal.html#`.

### cancelThumbnailRequest

Added in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Deprecated in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
open static fun cancelThumbnailRequest(
    cr: ContentResolver!, 
    videoId: Long, 
    groupId: Long
): Unit
```

**Deprecated:** *Callers should migrate to using `https://developer.android.com/reference/kotlin/android/content/ContentResolver.html#loadThumbnail(android.net.Uri,%20android.util.Size,%20android.os.CancellationSignal)`, since it offers richer control over requested thumbnail sizes and cancellation behavior.*

Cancel any outstanding #getThumbnail requests, causing them to return by throwing a `https://developer.android.com/reference/kotlin/android/os/OperationCanceledException.html#`.

This method has no effect on `https://developer.android.com/reference/kotlin/android/content/ContentResolver.html#loadThumbnail(android.net.Uri,%20android.util.Size,%20android.os.CancellationSignal)` calls, since they provide their own `https://developer.android.com/reference/kotlin/android/os/CancellationSignal.html#`.

### getContentUri

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
open static fun getContentUri(volumeName: String!): Uri!
```

**Deprecated:** *Deprecated in Java.*

Get the content:// style URI for the image media table on the given volume.

| Parameters ||
|---|---|
| `volumeName` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!: the name of the volume to get the URI for |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/net/Uri.html#!` | the URI to the image media table on the given volume |

### getKindSize

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Deprecated in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
open static fun getKindSize(kind: Int): Size
```

**Deprecated:** *Callers should migrate to using `https://developer.android.com/reference/kotlin/android/content/ContentResolver.html#loadThumbnail(android.net.Uri,%20android.util.Size,%20android.os.CancellationSignal)`, since it offers richer control over requested thumbnail sizes and cancellation behavior.*

Return the typical `https://developer.android.com/reference/kotlin/android/util/Size.html#` (in pixels) used internally when the given thumbnail kind is requested.

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/util/Size.html#` | This value cannot be `null`. |

### getThumbnail

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
open static fun getThumbnail(
    cr: ContentResolver!, 
    videoId: Long, 
    kind: Int, 
    options: BitmapFactory.Options!
): Bitmap!
```

**Deprecated:** *Callers should migrate to using `https://developer.android.com/reference/kotlin/android/content/ContentResolver.html#loadThumbnail(android.net.Uri,%20android.util.Size,%20android.os.CancellationSignal)`, since it offers richer control over requested thumbnail sizes and cancellation behavior.*

Return thumbnail representing a specific video item. If a thumbnail doesn't exist, this method will block until it's generated. Callers are responsible for their own in-memory caching of returned values.

| Parameters ||
|---|---|
| `videoId` | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html): the video item to obtain a thumbnail for. |
| `kind` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): optimal thumbnail size desired. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/graphics/Bitmap.html#!` | decoded thumbnail, or `null` if problem was encountered. |

### getThumbnail

Added in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Deprecated in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
open static fun getThumbnail(
    cr: ContentResolver!, 
    videoId: Long, 
    groupId: Long, 
    kind: Int, 
    options: BitmapFactory.Options!
): Bitmap!
```

**Deprecated:** *Callers should migrate to using `https://developer.android.com/reference/kotlin/android/content/ContentResolver.html#loadThumbnail(android.net.Uri,%20android.util.Size,%20android.os.CancellationSignal)`, since it offers richer control over requested thumbnail sizes and cancellation behavior.*

Return thumbnail representing a specific video item. If a thumbnail doesn't exist, this method will block until it's generated. Callers are responsible for their own in-memory caching of returned values.

| Parameters ||
|---|---|
| `videoId` | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html): the video item to obtain a thumbnail for. |
| `kind` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): optimal thumbnail size desired. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/graphics/Bitmap.html#!` | decoded thumbnail, or `null` if problem was encountered. |

## Properties

### EXTERNAL_CONTENT_URI

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
static val EXTERNAL_CONTENT_URI: Uri!
```

**Deprecated:** *Deprecated in Java.*

The content:// style URI for the "primary" external storage volume.

### INTERNAL_CONTENT_URI

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
static val INTERNAL_CONTENT_URI: Uri!
```

**Deprecated:** *Deprecated in Java.*

The content:// style URI for the internal storage.