If something happens in my app I want to kill the app there and then. In swift I can use fatalError(), is there a java equivalent?
I don't there's any method equivalent to fatalError
in Android.
If you want to kill the entire process then you can use android.os.Process.killProcess(android.os.Process.myPid());
.
To mimic the same behaviour of fatalError
you'll probably have to implement it yourself.
The behaviour you'll need to add besides killing the process is
Log