Dela via


StorageManager.StorageVolumeCallback.OnStateChanged(StorageVolume) Method

Definition

Called when StorageVolume#getState() changes, such as changing to the Environment#MEDIA_MOUNTED or Environment#MEDIA_UNMOUNTED states.

[Android.Runtime.Register("onStateChanged", "(Landroid/os/storage/StorageVolume;)V", "GetOnStateChanged_Landroid_os_storage_StorageVolume_Handler", ApiSince=30)]
public virtual void OnStateChanged (Android.OS.Storage.StorageVolume volume);
[<Android.Runtime.Register("onStateChanged", "(Landroid/os/storage/StorageVolume;)V", "GetOnStateChanged_Landroid_os_storage_StorageVolume_Handler", ApiSince=30)>]
abstract member OnStateChanged : Android.OS.Storage.StorageVolume -> unit
override this.OnStateChanged : Android.OS.Storage.StorageVolume -> unit

Parameters

volume
StorageVolume
Attributes

Remarks

Called when StorageVolume#getState() changes, such as changing to the Environment#MEDIA_MOUNTED or Environment#MEDIA_UNMOUNTED states.

The given argument is a snapshot in time and can be used to process events in the order they occurred, or you can call StorageManager#getStorageVolumes() to observe the latest value.

Java documentation for android.os.storage.StorageManager.StorageVolumeCallback.onStateChanged(android.os.storage.StorageVolume).

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