[ Web Proxy ]
URL:
Viewing: https://developer.android.com/reference/androidx/media3/datasource/DataSourceBitmapLoader [Back]  [Original]

DataSourceBitmapLoader  |  API reference  |  Android Developers Skip to main content
Essentials Design & Plan Develop Google Play Blog
Search:
Android Studio
Android Developers [Android Developers]
Stay organized with collections Save and categorize content based on your preferences.

DataSourceBitmapLoader


@UnstableApi
public final class DataSourceBitmapLoader implements BitmapLoader


A BitmapLoader implementation that uses a DataSource to support fetching images from URIs and BitmapFactory to load them into Bitmap.

Loading tasks are delegated to a ListeningExecutorService defined during construction. If no executor service is passed, all tasks are delegated to a single-thread executor service that is shared between instances of this class.

Summary

Nested types

A builder for DataSourceBitmapLoader instances.

Constants

static final Supplier<ListeningExecutorService>

Public constructors

This method is deprecated.

Use Builder instead.

DataSourceBitmapLoader(Context context, int maximumOutputDimension)

This method is deprecated.

Use Builder instead.

DataSourceBitmapLoader(
    ListeningExecutorService listeningExecutorService,
    DataSource.Factory dataSourceFactory
)

This method is deprecated.

Use Builder instead.

DataSourceBitmapLoader(
    ListeningExecutorService listeningExecutorService,
    DataSource.Factory dataSourceFactory,
    @Nullable BitmapFactory.Options options
)

This method is deprecated.

Use Builder instead.

DataSourceBitmapLoader(
    ListeningExecutorService listeningExecutorService,
    DataSource.Factory dataSourceFactory,
    @Nullable BitmapFactory.Options options,
    int maximumOutputDimension
)

This method is deprecated.

Use Builder instead.

Public methods

ListenableFuture<Bitmap>
decodeBitmap(byte[] data)

Decodes an image from compressed binary data.

ListenableFuture<Bitmap>

Loads an image from uri.

boolean

Returns whether the given mimeType is supported.

Inherited methods

From androidx.media3.common.util.BitmapLoader

Constants

DEFAULT_EXECUTOR_SERVICE

public static final Supplier<ListeningExecutorServiceDEFAULT_EXECUTOR_SERVICE

Public constructors

DataSourceBitmapLoader

public DataSourceBitmapLoader(Context context)
This method is deprecated.

Use Builder instead.

DataSourceBitmapLoader

public DataSourceBitmapLoader(Context context, int maximumOutputDimension)
This method is deprecated.

Use Builder instead.

DataSourceBitmapLoader

public DataSourceBitmapLoader(
    ListeningExecutorService listeningExecutorService,
    DataSource.Factory dataSourceFactory
)
This method is deprecated.

Use Builder instead.

DataSourceBitmapLoader

public DataSourceBitmapLoader(
    ListeningExecutorService listeningExecutorService,
    DataSource.Factory dataSourceFactory,
    @Nullable BitmapFactory.Options options
)
This method is deprecated.

Use Builder instead.

DataSourceBitmapLoader

public DataSourceBitmapLoader(
    ListeningExecutorService listeningExecutorService,
    DataSource.Factory dataSourceFactory,
    @Nullable BitmapFactory.Options options,
    int maximumOutputDimension
)
This method is deprecated.

Use Builder instead.

Public methods

decodeBitmap

public ListenableFuture<BitmapdecodeBitmap(byte[] data)

Decodes an image from compressed binary data.

loadBitmap

public ListenableFuture<BitmaploadBitmap(Uri uri)

Loads an image from uri.

supportsMimeType

public boolean supportsMimeType(String mimeType)

Returns whether the given mimeType is supported.

Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Last updated 2026-08-06 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-08-06 UTC."],[],[]]

Web Proxy Viewer  |  New URL  |  Original Page