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:
Bernhard Kaindl
2012-08-07 14:03:20 +02:00
parent 267b9174eb
commit 49d8e7dbeb
6 changed files with 45 additions and 9 deletions

View File

@@ -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()
{