Language

MediaStore.TrashFile(ContentResolver, String) Method

Definition

Moves a file or directory to a trashed state.

[Android.Runtime.Register("trashFile", "(Landroid/content/ContentResolver;Ljava/lang/String;)Ljava/lang/String;", "", ApiSince=37)]
[Android.Runtime.RequiresPermission("android.permission.MANAGE_EXTERNAL_STORAGE")]
public static string TrashFile(Android.Content.ContentResolver resolver, string path);
[<Android.Runtime.Register("trashFile", "(Landroid/content/ContentResolver;Ljava/lang/String;)Ljava/lang/String;", "", ApiSince=37)>]
[<Android.Runtime.RequiresPermission("android.permission.MANAGE_EXTERNAL_STORAGE")>]
static member TrashFile : Android.Content.ContentResolver * string -> string

Parameters

resolver
ContentResolver

The ContentResolver to use for the call.

path
String

The absolute path of the file or directory to be trashed.

Returns

The path of the item that was trashed, which may differ from the input path if the system modifies it for trash management.

Attributes

Remarks

Moves a file or directory to a trashed state.

If the specified path is a directory, all its contents (files and subdirectories) will also be trashed recursively.

Apps using this API must declare the Manifest.permission.MANAGE_EXTERNAL_STORAGE permission in their manifest and be granted it by the user.

Android reference for android.provider.MediaStore.trashFile.

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