optimize the logic in lifecycle method onCreate() if the activity is
being restored from a previous state