Skip to content

Most visited

Recently visited

navigation
added in API level 14

TextureView.SurfaceTextureListener

public static interface TextureView.SurfaceTextureListener

android.view.TextureView.SurfaceTextureListener


This listener can be used to be notified when the surface texture associated with this texture view is available.

Summary

Public methods

abstract void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height)

Invoked when a TextureView's SurfaceTexture is ready for use.

abstract boolean onSurfaceTextureDestroyed(SurfaceTexture surface)

Invoked when the specified SurfaceTexture is about to be destroyed.

abstract void onSurfaceTextureSizeChanged(SurfaceTexture surface, int width, int height)

Invoked when the SurfaceTexture's buffers size changed.

abstract void onSurfaceTextureUpdated(SurfaceTexture surface)

Invoked when the specified SurfaceTexture is updated through updateTexImage().

Public methods

onSurfaceTextureAvailable

added in API level 14
void onSurfaceTextureAvailable (SurfaceTexture surface, 
                int width, 
                int height)

Invoked when a TextureView's SurfaceTexture is ready for use.

Parameters
surface SurfaceTexture: The surface returned by getSurfaceTexture()

width int: The width of the surface

height int: The height of the surface

onSurfaceTextureDestroyed

added in API level 14
boolean onSurfaceTextureDestroyed (SurfaceTexture surface)

Invoked when the specified SurfaceTexture is about to be destroyed. If returns true, no rendering should happen inside the surface texture after this method is invoked. If returns false, the client needs to call release(). Most applications should return true.

Parameters
surface SurfaceTexture: The surface about to be destroyed

Returns
boolean

onSurfaceTextureSizeChanged

added in API level 14
void onSurfaceTextureSizeChanged (SurfaceTexture surface, 
                int width, 
                int height)

Invoked when the SurfaceTexture's buffers size changed.

Parameters
surface SurfaceTexture: The surface returned by getSurfaceTexture()

width int: The new width of the surface

height int: The new height of the surface

onSurfaceTextureUpdated

added in API level 14
void onSurfaceTextureUpdated (SurfaceTexture surface)

Invoked when the specified SurfaceTexture is updated through updateTexImage().

Parameters
surface SurfaceTexture: The surface just updated

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience. (Dec 2017 Android Platform & Tools Survey)