Added in API level 34

PixelCopy.Result


public static final class PixelCopy.Result
extends Object

java.lang.Object
   ↳ android.view.PixelCopy.Result


Contains the result of a PixelCopy request

Summary

Public methods

Bitmap getBitmap()

If the PixelCopy Request was given a destination bitmap with PixelCopy.Request.Builder.setDestinationBitmap(Bitmap) then the returned bitmap will be the same as the one given.

int getStatus()

Returns the status of the copy request.

Inherited methods

Public methods

getBitmap

Added in API level 34
public Bitmap getBitmap ()

If the PixelCopy Request was given a destination bitmap with PixelCopy.Request.Builder.setDestinationBitmap(Bitmap) then the returned bitmap will be the same as the one given. If no destination bitmap was provided, then this will contain the automatically allocated Bitmap to hold the result.

Returns
Bitmap the Bitmap the copy request was stored in. This value cannot be null.

Throws
IllegalStateException if getStatus() is not SUCCESS

getStatus

Added in API level 34
public int getStatus ()

Returns the status of the copy request.

Returns
int Value is PixelCopy.SUCCESS, PixelCopy.ERROR_UNKNOWN, PixelCopy.ERROR_TIMEOUT, PixelCopy.ERROR_SOURCE_NO_DATA, PixelCopy.ERROR_SOURCE_INVALID, or PixelCopy.ERROR_DESTINATION_INVALID