While the following items do, to some degree, oversimplify the situation, for app developers just starting out, this section provides some basic guidelines for what to do. These guidelines can assist in "bringing up" an app; once brought up, significant lifecycle testing should be done on a range of devices.
onCreate
onCreate
but before the window and surface are ready.surfaceCreated
surfaceCreated
callback is the earliest that the application can create its EGLSurface
and thus is the earliest that it can bind a context, load OpenGL ES resources, and render. onResume
and onPause
. surfaceCreated
and surfaceDestroyed
. onWindowFocusChanged(TRUE)
and onWindowFocusChanged(FALSE)
. onWindowFocusChanged(FALSE)
onPause
onResume
after onPause
onWindowFocusChanged(TRUE)
after onResume
onStop
EGLContext
is still bound, or via eglDestroyContext
if the context has been unbound because the rendering surface was destroyed).onDestroy
NVIDIA® GameWorks™ Documentation Rev. 1.0.211026 ©2014-2021. NVIDIA Corporation and affiliates. All Rights Reserved.