Currently we can catch exceptions with Try-Catch, but not the OutOfMemory error. Could you add this (the easy way is probably to throw an exception when the error is catched in Java, so it can be catched by Try-Catch in Basic)?
Java Errors are not meant to be caught, unlike Exceptions.
You can create a library method that will start a sub (with raiseEvent) and catch errors:
B4X:try { ba.raiseEvent(...) } catch (Throwable t) { throw new RuntimeException(t); }
Starting from the next version out of memory exceptions related to bitmaps will be handled internally. I believe that this will solve 99% of the OOM errors.