Android: Fix crash when hitting Back button to quit

On Android, it's possible to reach the condition when window == 0
if you hit the Back key, since the previous bail-out is disabled
for this case. To avoid a null-pointer dereference, an extra
check is required.

Change-Id: Ic898cd82dd6e52c24505dd2248c98efcefc15b1c
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
JNI Convenience: Use isSameObject() when comparing jobjects.

Comparing the value of two jobjects are not safe, as it's not guaranteed
that two jobjects that is referencing the same object,
will have the same value. To make things worse two jobjects might have
the same value even though they reference two different objects...

Change-Id: I997ea8abfb8c687c342b261bba3848cbbd741633
Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
JNI Convenience: Make it possible to copy QJNIObjects.

Change-Id: I692242147d5f908381ea9d3b393b3c591385efd4
Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
JNI Convenience: Print exceptions in debug mode.

The exception message might contain valuable information about what went
wrong, so we should print the message.

Change-Id: I50c986d4c18cf6115017fcc92363c946be45024d
Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
JNI Convenience: Make single argument ctors explicit.

Change-Id: I330e4acf9b944fc72066b608653edd4686620b7e
Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>