Initial commit of handling of onPause()
onPause() is called on ICS when the back button is pressed before the task lists is shown. With this commit, opentyrian pauses an ongoing level and waits for a key before continuing it. It does however not silence the music, which may be desirable as well (to be added with the next commit)
This commit is contained in:
@@ -285,6 +285,17 @@ public class MainActivity extends Activity {
|
||||
}
|
||||
_isPaused = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWindowFocusChanged (boolean hasFocus) {
|
||||
super.onWindowFocusChanged(hasFocus);
|
||||
if (hasFocus == false) {
|
||||
synchronized(textInput) {
|
||||
// Send 'SDLK_PAUSE' (to enter pause mode) to native code:
|
||||
DemoRenderer.nativeTextInput( 19, 19 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isPaused()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user