共用方式為


IComponentCallbacks.OnConfigurationChanged(Configuration) Method

Definition

Called by the system when the device configuration changes while your component is running.

[Android.Runtime.Register("onConfigurationChanged", "(Landroid/content/res/Configuration;)V", "GetOnConfigurationChanged_Landroid_content_res_Configuration_Handler:Android.Content.IComponentCallbacksInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public void OnConfigurationChanged (Android.Content.Res.Configuration newConfig);
[<Android.Runtime.Register("onConfigurationChanged", "(Landroid/content/res/Configuration;)V", "GetOnConfigurationChanged_Landroid_content_res_Configuration_Handler:Android.Content.IComponentCallbacksInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member OnConfigurationChanged : Android.Content.Res.Configuration -> unit

Parameters

newConfig
Configuration

The new device configuration.

Attributes

Remarks

Called by the system when the device configuration changes while your component is running. Note that, unlike activities, other components are never restarted when a configuration changes: they must always deal with the results of the change, such as by re-retrieving resources.

At the time that this function has been called, your Resources object will have been updated to return resource values matching the new configuration.

For more information, read Handling Runtime Changes.

Java documentation for android.content.ComponentCallbacks.onConfigurationChanged(android.content.res.Configuration).

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