共用方式為


PreferenceActivity.IsValidFragment(String) Method

Definition

Subclasses should override this method and verify that the given fragment is a valid type to be attached to this activity.

[Android.Runtime.Register("isValidFragment", "(Ljava/lang/String;)Z", "GetIsValidFragment_Ljava_lang_String_Handler")]
protected virtual bool IsValidFragment (string? fragmentName);
[<Android.Runtime.Register("isValidFragment", "(Ljava/lang/String;)Z", "GetIsValidFragment_Ljava_lang_String_Handler")>]
abstract member IsValidFragment : string -> bool
override this.IsValidFragment : string -> bool

Parameters

fragmentName
String

the class name of the Fragment about to be attached to this activity.

Returns

true if the fragment class name is valid for this Activity and false otherwise.

Attributes

Remarks

Subclasses should override this method and verify that the given fragment is a valid type to be attached to this activity. The default implementation returns true for apps built for android:targetSdkVersion older than android.os.Build.VERSION_CODES#KITKAT. For later versions, it will throw an exception.

Java documentation for android.preference.PreferenceActivity.isValidFragment(java.lang.String).

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