Called when the fragment is first created. Sets the fragment to be retained across configuration changes.