Merge "Avoid NullPointerException when activity is automatically recreated"