# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Methods | Inherited Methods

# SurfaceHolder.Callback2

`public static interface SurfaceHolder.Callback2`
`implements SurfaceHolder.Callback`

android.view.SurfaceHolder.Callback2

Known indirect subclasses GLSurfaceView, NativeActivity
GLSurfaceView | An implementation of SurfaceView that uses the dedicated surface for displaying OpenGL rendering.
NativeActivity | Convenience for implementing an activity that will be implemented purely in native code.

Additional callbacks that can be received for `Callback`.

## Summary

### Public methods
`abstract void` | `surfaceRedrawNeeded(SurfaceHolder holder)` Called when the application needs to redraw the content of its surface, after it is resized or for some other reason.
`default void` | `surfaceRedrawNeededAsync(SurfaceHolder holder, Runnable drawingFinished)` An alternative to surfaceRedrawNeeded where it is not required to block until the redraw is complete.

### Inherited methods
From interface `android.view.SurfaceHolder.Callback`
`abstract void` | `surfaceChanged(SurfaceHolder holder, int format, int width, int height)` This is called immediately after any structural changes (format or size) have been made to the surface.
`abstract void` | `surfaceCreated(SurfaceHolder holder)` This is called immediately after the surface is first created.
`abstract void` | `surfaceDestroyed(SurfaceHolder holder)` This is called immediately before a surface is being destroyed.

## Public methods

### surfaceRedrawNeeded

    public abstract void surfaceRedrawNeeded (SurfaceHolder holder)

Called when the application needs to redraw the content of its surface, after it is resized or for some other reason. By not returning from here until the redraw is complete, you can ensure that the user will not see your surface in a bad state (at its new size before it has been correctly drawn that way). This will typically be preceeded by a call to `SurfaceHolder.Callback.surfaceChanged(SurfaceHolder, int, int, int)`. As of O, `surfaceRedrawNeededAsync(SurfaceHolder, Runnable)` may be implemented to provide a non-blocking implementation. If `surfaceRedrawNeededAsync(SurfaceHolder, Runnable)` is not implemented, then this will be called instead.

Parameters
`holder` | `SurfaceHolder`: The SurfaceHolder whose surface has changed. This value cannot be `null`.

### surfaceRedrawNeededAsync

    public void surfaceRedrawNeededAsync (SurfaceHolder holder,
                    Runnable drawingFinished)

An alternative to surfaceRedrawNeeded where it is not required to block until the redraw is complete. You should initiate the redraw, and return, later invoking drawingFinished when your redraw is complete. This can be useful to avoid blocking your main application thread on rendering. As of O, if this is implemented `surfaceRedrawNeeded(SurfaceHolder)` will not be called. However it is still recommended to implement `surfaceRedrawNeeded(SurfaceHolder)` for compatibility with older versions of the platform.

Parameters
`holder` | `SurfaceHolder`: The SurfaceHolder which needs redrawing. This value cannot be `null`.
`drawingFinished` | `Runnable`: A runnable to signal completion. This may be invoked from any thread. This value cannot be `null`.

Full name *
Email address *
Company / developer name
One of your Play Store app URLs *
Which best describes your business:*
Apps
Games
Apps & Games
*
*