First implementation to handle configuration changes in the activity