Null pointer error in thread

Why are you directly invoking draw() there?
We shouldn’t invoke callbacks by ourselves.
That’s why you are registering it, so it’s invoked by something else.

That try / catch block is outta place there! There’s nothing to be caught!

Inside that custom draw() callback you need to place all the stuff that can’t be done outside the “Animation” Thread.