Android Guides | Samples


Abstract interface to someone holding a display surface.

See Also: ISurfaceHolder


[Android.Runtime.Register("android/view/SurfaceHolder", "", "Android.Views.ISurfaceHolderInvoker")]
public interface ISurfaceHolder : IJavaObject, IDisposable


Abstract interface to someone holding a display surface. Allows you to control the surface size and format, edit the pixels in the surface, and monitor changes to the surface. This interface is typically available through the SurfaceView class.

When using this interface from a thread other than the one running its SurfaceView, you will want to carefully read the methods ISurfaceHolder.LockCanvas and ISurfaceHolderCallback.SurfaceCreated(ISurfaceHolder).

[Android Documentation]


Namespace: Android.Views
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions:
Since: Added in API level 1

The members of Android.Views.ISurfaceHolder are listed below.

Public Properties

IsCreatingBoolean. Use this method to find out if the surface is in the process of being created from Callback methods.
SurfaceSurface. Direct access to the surface object.
SurfaceFrameRect. Retrieve the current size of the surface.

Public Methods

Add a Callback interface for this holder.
LockCanvas() : Canvas
Start editing the pixels in the surface.
LockCanvas(Rect) : Canvas
Just like ISurfaceHolder.LockCanvas but allows specification of a dirty rectangle.
Removes a previously added Callback interface from this holder.
SetFixedSize(Int32, Int32)
Make the surface a fixed size.
Set the desired PixelFormat of the surface.
Enable or disable option to keep the screen turned on while this surface is displayed.
Allow the surface to resized based on layout of its container (this is the default).
Sets the surface's type.
Finish editing pixels in the surface.