I want to make an UI in my Script (SinglePlayerCommands) but I can't create it without an error.
So i took the error code an put it in an new script (and again the same error). (I have the error on 2 commands)
ctx = com.mojang.minecraftpe.MainActivity.currentMainActivity.get();
var version = "9.9.9";function procCmd(command)
{
var cmd = command.split(" ");
switch(cmd[0])
{
case "spcpe":
showCredits();
break;
}
}
function showCredits() {
var info = new android.app.AlertDialog.Builder(ctx);
info.setTitle("Information");
info.setMessage("Version " + version + "\nSinglePlayerCommands by Orbitron!");
info.setNegativeButton("Ok", new android.content.DialogInterface.OnClickListener() {
onClick: function(par1){
dialog.dismiss();
}
});
var dialog = info.create();
dialog.show();
}
And with the error:
Error occurred in script: SPC-Error.js
org.mozilla.javascript.WrappedException: Wrapped java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare() (SPC-Error.js#24)
[...]
So i took the error code an put it in an new script (and again the same error). (I have the error on 2 commands)
And with the error:
Please help
So I tried yours, and it wonted too. Hahaha
OHHHHHHH I see the error too hahahah thx you are the best.