Added onSaveInstanceState function to enable information to be saved when the application change state