Added onSaveInstanceState() for saving variable states