mirror of
https://github.com/2009scape/2009Scape-mobile.git
synced 2025-12-18 12:30:11 -07:00
Handle java exit code
This commit is contained in:
parent
b61b0f17a4
commit
9741b05dfd
2 changed files with 9 additions and 7 deletions
|
|
@ -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();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue