Commit eeeabdae authored by fallenstardust's avatar fallenstardust

游戏退出返回游戏主页

parent dcd7f433
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
package cn.garymb.ygomobile; package cn.garymb.ygomobile;
import android.app.NativeActivity; import android.app.NativeActivity;
import android.content.BroadcastReceiver;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.pm.ActivityInfo; import android.content.pm.ActivityInfo;
...@@ -61,6 +60,9 @@ public class YGOMobileActivity extends NativeActivity implements ...@@ -61,6 +60,9 @@ public class YGOMobileActivity extends NativeActivity implements
private static final int CHAIN_CONTROL_PANEL_X_POSITION_LEFT_EDGE = 205; private static final int CHAIN_CONTROL_PANEL_X_POSITION_LEFT_EDGE = 205;
private static final int CHAIN_CONTROL_PANEL_Y_REVERT_POSITION = 100; private static final int CHAIN_CONTROL_PANEL_Y_REVERT_POSITION = 100;
private static final int MAX_REFRESH = 30 * 1000; private static final int MAX_REFRESH = 30 * 1000;
private static int sChainControlXPostion = -1;
private static int sChainControlYPostion = -1;
private static boolean USE_SURFACE = true;
protected final int windowsFlags = protected final int windowsFlags =
Build.VERSION.SDK_INT >= 19 ? ( Build.VERSION.SDK_INT >= 19 ? (
View.SYSTEM_UI_FLAG_LAYOUT_STABLE View.SYSTEM_UI_FLAG_LAYOUT_STABLE
...@@ -69,7 +71,6 @@ public class YGOMobileActivity extends NativeActivity implements ...@@ -69,7 +71,6 @@ public class YGOMobileActivity extends NativeActivity implements
| View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY) : | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY) :
View.SYSTEM_UI_FLAG_LOW_PROFILE; View.SYSTEM_UI_FLAG_LOW_PROFILE;
protected View mContentView; protected View mContentView;
protected ComboBoxCompat mGlobalComboBox; protected ComboBoxCompat mGlobalComboBox;
protected EditWindowCompat mGlobalEditText; protected EditWindowCompat mGlobalEditText;
...@@ -79,8 +80,6 @@ public class YGOMobileActivity extends NativeActivity implements ...@@ -79,8 +80,6 @@ public class YGOMobileActivity extends NativeActivity implements
private NetworkController mNetController; private NetworkController mNetController;
private volatile boolean mOverlayShowRequest = false; private volatile boolean mOverlayShowRequest = false;
private volatile int mCompatGUIMode; private volatile int mCompatGUIMode;
private static int sChainControlXPostion = -1;
private static int sChainControlYPostion = -1;
private GameApplication mApp; private GameApplication mApp;
private Handler handler = new Handler(); private Handler handler = new Handler();
private FullScreenUtils mFullScreenUtils; private FullScreenUtils mFullScreenUtils;
...@@ -88,10 +87,12 @@ public class YGOMobileActivity extends NativeActivity implements ...@@ -88,10 +87,12 @@ public class YGOMobileActivity extends NativeActivity implements
private FrameLayout mLayout; private FrameLayout mLayout;
private SurfaceView mSurfaceView; private SurfaceView mSurfaceView;
private boolean replaced = false; private boolean replaced = false;
private static boolean USE_SURFACE = true;
private String[] mArgV; private String[] mArgV;
// public static int notchHeight; // public static int notchHeight;
//电池管理
private PowerManager mPM;
private PowerManager.WakeLock mLock;
private GameApplication app() { private GameApplication app() {
if (mApp == null) { if (mApp == null) {
...@@ -137,10 +138,6 @@ public class YGOMobileActivity extends NativeActivity implements ...@@ -137,10 +138,6 @@ public class YGOMobileActivity extends NativeActivity implements
.setPackage(getPackageName())); .setPackage(getPackageName()));
} }
//电池管理
private PowerManager mPM;
private PowerManager.WakeLock mLock;
@Override @Override
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
...@@ -551,6 +548,16 @@ public class YGOMobileActivity extends NativeActivity implements ...@@ -551,6 +548,16 @@ public class YGOMobileActivity extends NativeActivity implements
@Override @Override
public void onGameExit() { public void onGameExit() {
Log.e("ygomobile", "game exit"); Log.e("ygomobile", "game exit");
Intent intent = new Intent("ygomobile.intent.action.GAME");
intent.addCategory(Intent.CATEGORY_DEFAULT);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.addFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
intent.setPackage(getPackageName());
try {
startActivity(intent);
} catch (Throwable ignore) {
}
Process.killProcess(Process.myPid()); Process.killProcess(Process.myPid());
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment