public static interface ImageDecoder.OnHeaderDecodedListener

android.graphics.ImageDecoder.OnHeaderDecodedListener



Interface for changing the default settings of a decode.

Supply an instance to decodeDrawable or decodeBitmap, which will call onHeaderDecoded (in the same thread) once the size is known. The implementation of onHeaderDecoded can then change the decode settings as desired.

Summary

Public methods

abstract void onHeaderDecoded(ImageDecoder decoder, ImageDecoder.ImageInfo info, ImageDecoder.Source source)

Called by ImageDecoder when the header has been decoded and the image size is known.

Public methods

onHeaderDecoded

public abstract void onHeaderDecoded (ImageDecoder decoder, 
                ImageDecoder.ImageInfo info, 
                ImageDecoder.Source source)

Called by ImageDecoder when the header has been decoded and the image size is known.

Parameters
decoder ImageDecoder: the object performing the decode, for changing its default settings.
This value cannot be null.
info ImageDecoder.ImageInfo: information about the encoded image.
This value cannot be null.
source ImageDecoder.Source: object that created decoder.
This value cannot be null.

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-02-13 UTC.