Added keyboard closing support and a fix for the NDK bug that locks up the app when closing keyboard