Change to the Recent Apps button behavior on Android 4.X - now it will delete OpenGL context, and freeze the app.

This commit is contained in:
pelya
2012-08-12 19:14:08 +03:00
parent 4ccba0347a
commit 3ee1c890b1
2 changed files with 16 additions and 4 deletions

View File

@@ -289,12 +289,19 @@ public class MainActivity extends Activity {
@Override
public void onWindowFocusChanged (boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
System.out.println("libSDL: onWindowFocusChanged: " + hasFocus + " - sending onPause/onResume");
if (hasFocus == false)
onPause();
else
onResume();
/*
if (hasFocus == false) {
synchronized(textInput) {
// Send 'SDLK_PAUSE' (to enter pause mode) to native code:
DemoRenderer.nativeTextInput( 19, 19 );
}
}
*/
}
public boolean isPaused()
@@ -303,7 +310,7 @@ public class MainActivity extends Activity {
}
@Override
protected void onDestroy()
protected void onDestroy()
{
if( downloader != null )
{