다음을 통해 공유


Fragment.OnActivityCreated(Bundle) Method

Definition

Called when the fragment's activity has been created and this fragment's view hierarchy instantiated.

[Android.Runtime.Register("onActivityCreated", "(Landroid/os/Bundle;)V", "GetOnActivityCreated_Landroid_os_Bundle_Handler")]
public virtual void OnActivityCreated (Android.OS.Bundle? savedInstanceState);
[<Android.Runtime.Register("onActivityCreated", "(Landroid/os/Bundle;)V", "GetOnActivityCreated_Landroid_os_Bundle_Handler")>]
abstract member OnActivityCreated : Android.OS.Bundle -> unit
override this.OnActivityCreated : Android.OS.Bundle -> unit

Parameters

savedInstanceState
Bundle

If the fragment is being re-created from a previous saved state, this is the state.

Attributes

Remarks

Called when the fragment's activity has been created and this fragment's view hierarchy instantiated. It can be used to do final initialization once these pieces are in place, such as retrieving views or restoring state. It is also useful for fragments that use #setRetainInstance(boolean) to retain their instance, as this callback tells the fragment when it is fully associated with the new activity instance. This is called after #onCreateView and before #onViewStateRestored(Bundle).

Java documentation for android.app.Fragment.onActivityCreated(android.os.Bundle).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to