Fix NPE after screen orientation (fix #230)

Signed-off-by: Daniele Ricci <daniele.athome@gmail.com>