Ok, so maybe it is because its four thirty on a Friday, but I have a question I think I will regret later on.
I have an android activity that implements java.lang.Thread.UncaughtExceptionHandler, and I want to throw some exceptions in various places(To make sure an unexpected one would be caught later). I just realized you cant just throw and exception outside a try catch, and unfortunately my project doesn't build and execute with obvious exceptions like setting values for uninitialized objects(Unfortunate right).
So whats the best way I can make my android app crash real good?
throw new RuntimeException("This is a crash... AHHHHH!!!!");
You're lucky my friend, I was doing the exact same thing today and found a way to crash my app. Try using the above code somewhere like when you press a button to force a crash. Then just click all over and Android will ask you to close your app. Crash achieved! That's what worked for me at least.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With