Udostępnij za pośrednictwem


ISurfaceHolderCallback2.SurfaceRedrawNeededAsync Method

Definition

An alternative to surfaceRedrawNeeded where it is not required to block until the redraw is complete.

[Android.Runtime.Register("surfaceRedrawNeededAsync", "(Landroid/view/SurfaceHolder;Ljava/lang/Runnable;)V", "GetSurfaceRedrawNeededAsync_Landroid_view_SurfaceHolder_Ljava_lang_Runnable_Handler:Android.Views.ISurfaceHolderCallback2, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)]
public virtual void SurfaceRedrawNeededAsync (Android.Views.ISurfaceHolder holder, Java.Lang.IRunnable drawingFinished);
[<Android.Runtime.Register("surfaceRedrawNeededAsync", "(Landroid/view/SurfaceHolder;Ljava/lang/Runnable;)V", "GetSurfaceRedrawNeededAsync_Landroid_view_SurfaceHolder_Ljava_lang_Runnable_Handler:Android.Views.ISurfaceHolderCallback2, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)>]
abstract member SurfaceRedrawNeededAsync : Android.Views.ISurfaceHolder * Java.Lang.IRunnable -> unit
override this.SurfaceRedrawNeededAsync : Android.Views.ISurfaceHolder * Java.Lang.IRunnable -> unit

Parameters

holder
ISurfaceHolder

The SurfaceHolder which needs redrawing.

drawingFinished
IRunnable

A runnable to signal completion. This may be invoked from any thread.

Attributes

Remarks

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 will not be called. However it is still recommended to implement #surfaceRedrawNeeded for compatibility with older versions of the platform.

Java documentation for android.view.SurfaceHolder.Callback2.surfaceRedrawNeededAsync(android.view.SurfaceHolder, java.lang.Runnable).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to