mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-15 07:39:00 -04:00
Handle java exit code
This commit is contained in:
parent
b61b0f17a4
commit
9741b05dfd
@ -72,7 +72,8 @@ public final class Tools
|
||||
public static final int LAUNCH_TYPE = LTYPE_INVOCATION;
|
||||
|
||||
public static ShellProcessOperation mLaunchShell;
|
||||
public static void launchMinecraft(final Activity ctx, MCProfile.Builder profile, JMinecraftVersionList.Version versionInfo) throws Throwable {
|
||||
private static int exitCode = 0;
|
||||
public static void launchMinecraft(final LoggableActivity ctx, MCProfile.Builder profile, JMinecraftVersionList.Version versionInfo) throws Throwable {
|
||||
String[] launchArgs = getMinecraftArgs(profile, versionInfo);
|
||||
|
||||
List<String> javaArgList = new ArrayList<String>();
|
||||
@ -166,22 +167,24 @@ public final class Tools
|
||||
});
|
||||
*/
|
||||
|
||||
VMLauncher.launchJVM(javaArgList.toArray(new String[0]));
|
||||
exitCode = VMLauncher.launchJVM(javaArgList.toArray(new String[0]));
|
||||
ctx.appendlnToLog("Java Exit code: " + exitCode);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ctx.runOnUiThread(new Runnable(){
|
||||
@Override
|
||||
public void run() {
|
||||
AlertDialog.Builder dialog = new AlertDialog.Builder(ctx);
|
||||
dialog.setMessage(R.string.mcn_javaexit_title);
|
||||
dialog.setMessage(ctx.getString(R.string.mcn_exit_title, exitCode));
|
||||
dialog.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener(){
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface p1, int p2){
|
||||
ctx.finish();
|
||||
MainActivity.fullyExit();
|
||||
}
|
||||
});
|
||||
dialog.show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -145,8 +145,7 @@
|
||||
</string>
|
||||
-->
|
||||
<!-- MainActivity: strings -->
|
||||
<string name="mcn_javaexit_title">Application exited</string>
|
||||
<string name="mcn_exit_title">Game exited</string>
|
||||
<string name="mcn_exit_title">Application/Game exited with code %s</string>
|
||||
<string name="mcn_exit_call">Exit</string>
|
||||
<string name="mcn_exit_crash">Game Crash detected! Click OK to exit.</string>
|
||||
<string name="mcn_exit_errcrash">Unable to locate crash! You may ignore this.</string>
|
||||
|
Loading…
x
Reference in New Issue
Block a user