mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-12 14:16:58 -04:00
Debug: Show fatal error on launcher crash
This commit is contained in:
parent
9d4b607003
commit
5b12c7bfb4
@ -1,10 +1,19 @@
|
||||
package net.kdt.pojavlaunch;
|
||||
|
||||
import android.support.v7.app.*;
|
||||
import android.content.*;
|
||||
import android.os.*;
|
||||
import android.support.v7.app.*;
|
||||
|
||||
public class FatalErrorActivity extends AppCompatActivity
|
||||
{
|
||||
public static void showError(Context ctx, Throwable th) {
|
||||
Intent ferrorIntent = new Intent(ctx, FatalErrorActivity.class);
|
||||
ferrorIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
||||
ferrorIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
ferrorIntent.putExtra("throwable", th);
|
||||
ctx.startActivity(ferrorIntent);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
@ -14,6 +14,14 @@ public class PojavApplication extends Application
|
||||
{
|
||||
@Override
|
||||
public void onCreate() {
|
||||
Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler(){
|
||||
@Override
|
||||
public void uncaughtException(Thread thread, Throwable th) {
|
||||
FatalErrorActivity.showError(PojavApplication.this, th);
|
||||
android.os.Process.killProcess(android.os.Process.myPid());
|
||||
}
|
||||
});
|
||||
|
||||
try {
|
||||
super.onCreate();
|
||||
Tools.APP_NAME = getResources().getString(R.string.app_short_name);
|
||||
|
Loading…
x
Reference in New Issue
Block a user