다음을 통해 공유


FragmentManager.PutFragment(Bundle, String, Fragment) Method

Definition

Put a reference to a fragment in a Bundle.

[Android.Runtime.Register("putFragment", "(Landroid/os/Bundle;Ljava/lang/String;Landroid/app/Fragment;)V", "GetPutFragment_Landroid_os_Bundle_Ljava_lang_String_Landroid_app_Fragment_Handler")]
public abstract void PutFragment (Android.OS.Bundle? bundle, string? key, Android.App.Fragment? fragment);
[<Android.Runtime.Register("putFragment", "(Landroid/os/Bundle;Ljava/lang/String;Landroid/app/Fragment;)V", "GetPutFragment_Landroid_os_Bundle_Ljava_lang_String_Landroid_app_Fragment_Handler")>]
abstract member PutFragment : Android.OS.Bundle * string * Android.App.Fragment -> unit

Parameters

bundle
Bundle

The bundle in which to put the fragment reference.

key
String

The name of the entry in the bundle.

fragment
Fragment

The Fragment whose reference is to be stored.

Attributes

Remarks

Put a reference to a fragment in a Bundle. This Bundle can be persisted as saved state, and when later restoring #getFragment(Bundle, String) will return the current instance of the same fragment.

Java documentation for android.app.FragmentManager.putFragment(android.os.Bundle, java.lang.String, android.app.Fragment).

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