mirror of
https://github.com/encounter/SDL.git
synced 2025-12-08 21:17:45 +00:00
Android: add MinimizeWindow function (Bug 4580, 4657)
shouldMinimizeOnFocusLoss is un-activated (return false)
This commit is contained in:
@@ -846,6 +846,45 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called by SDL using JNI.
|
||||
*/
|
||||
public static void minimizeWindow() {
|
||||
|
||||
if (mSingleton == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Intent startMain = new Intent(Intent.ACTION_MAIN);
|
||||
startMain.addCategory(Intent.CATEGORY_HOME);
|
||||
startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
mSingleton.startActivity(startMain);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called by SDL using JNI.
|
||||
*/
|
||||
public static boolean shouldMinimizeOnFocusLoss() {
|
||||
/*
|
||||
if (Build.VERSION.SDK_INT >= 24) {
|
||||
if (mSingleton == null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (mSingleton.isInMultiWindowMode()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mSingleton.isInPictureInPictureMode()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
*/
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called by SDL using JNI.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user