public interface ApplicationListener
An ApplicationListener
is called when the Application
is created, resumed, rendering, paused or destroyed.
All methods are called in a thread that has the OpenGL context current. You can thus safely create and manipulate graphics
resources.
The ApplicationListener
interface follows the standard Android activity life-cycle and is emulated on the desktop
accordingly.
Modifier and Type | Method and Description |
---|---|
void |
create()
Called when the
Application is first created. |
void |
dispose()
Called when the
Application is destroyed. |
void |
pause()
Called when the
Application is paused. |
void |
render()
Called when the
Application should render itself. |
void |
resize(int width,
int height)
Called when the
Application is resized. |
void |
resume()
Called when the
Application is resumed from a paused state. |
void create()
Application
is first created.void resize(int width, int height)
Application
is resized. This can happen at any point during a non-paused state but will never happen
before a call to create()
.width
- the new width in pixelsheight
- the new height in pixelsvoid render()
Application
should render itself.void pause()
Application
is paused. An Application is paused before it is destroyed, when a user pressed the Home
button on Android or an incoming call happened. On the desktop this will only be called immediately before dispose()
is called.void resume()
Application
is resumed from a paused state. On Android this happens when the activity gets focus
again. On the desktop this method will never be called.void dispose()
Application
is destroyed. Preceded by a call to pause()
.Copyright © 2014. All Rights Reserved.