コンテンツに移動

よくアクセスするページ

最近アクセスしたページ

navigation
added in API level 9

SurfaceHolder.Callback2

public static interface SurfaceHolder.Callback2
implements SurfaceHolder.Callback

android.view.SurfaceHolder.Callback2


Additional callbacks that can be received for SurfaceHolder.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

Public methods

surfaceRedrawNeeded

added in API level 9
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 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.

surfaceRedrawNeededAsync

added in API level 26
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.

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

このサイトでは、ユーザーが選択したサイトの言語と表示設定を保存する目的で Cookie を使用しています。

Android デベロッパー向けの最新情報やヒントを入手して、Google Play での成功を手に入れましょう。

* 必須

送信しました

WeChat で Google Developers をフォローする

このサイトをで表示しますか?

ページの表示言語としてを選択しましたが、このサイトの言語はに設定されています。

言語設定を変更してこのサイトをで表示しますか?言語設定を変更する場合は、各ページの下にある言語メニューを使用してください。

このクラスには、API レベル 以上が必要です。

API レベル が選択されているため、このドキュメントは非表示になっています。左のナビゲーションの上にあるセレクタを使って、ドキュメントの API レベルを変更できます。

アプリに必要な API レベルを指定する方法について、詳しくは異なるプラットフォーム バージョンのサポートをご覧ください。

Take a short survey?
Help us improve the Android developer experience. (April 2018 — Developer Survey)