MediaStore.OpenFileDescriptor メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
ContentResolver#openFileDescriptor(Uri, String, CancellationSignal)とまったく同じように動作しますが、スキームがContentResolver#SCHEME_CONTENTで権限がMediaStore#AUTHORITYUriに対してのみ機能します。
[Android.Runtime.Register("openFileDescriptor", "(Landroid/content/ContentResolver;Landroid/net/Uri;Ljava/lang/String;Landroid/os/CancellationSignal;)Landroid/os/ParcelFileDescriptor;", "", ApiSince=36)]
public static Android.OS.ParcelFileDescriptor? OpenFileDescriptor(Android.Content.ContentResolver resolver, Android.Net.Uri uri, string mode, Android.OS.CancellationSignal? cancellationSignal);
[<Android.Runtime.Register("openFileDescriptor", "(Landroid/content/ContentResolver;Landroid/net/Uri;Ljava/lang/String;Landroid/os/CancellationSignal;)Landroid/os/ParcelFileDescriptor;", "", ApiSince=36)>]
static member OpenFileDescriptor : Android.Content.ContentResolver * Android.Net.Uri * string * Android.OS.CancellationSignal -> Android.OS.ParcelFileDescriptor
パラメーター
- resolver
- ContentResolver
MediaStore#AUTHORITYとの接続に使用されるContentResolver。 通常、この値は Context#getContentResolver()
- uri
- Uri
開く目的の URI。
- mode
- String
ファイル モードの文字列形式。 "r"、"w"、"wt"、"wa"、"rw"、または "rwt" を指定できます。 これらの正確な実装は、プロバイダーの実装ごとに異なる場合があることに注意してください。たとえば、"w" は切り捨てられる場合と切り捨てられない場合があります。
- cancellationSignal
- CancellationSignal
進行中の操作を取り消すシグナル。存在しない場合は null。 操作が取り消されると、 OperationCanceledException がスローされます。
返品
ファイルを指す新しい ParcelFileDescriptor。プロバイダーが最近クラッシュした場合は null 。 この記述子はユーザーが所有しており、完了したらそれを閉じる責任があります。
- 属性
注釈
ContentResolver#openFileDescriptor(Uri, String, CancellationSignal)とまったく同じように動作しますが、スキームがContentResolver#SCHEME_CONTENTで権限がMediaStore#AUTHORITYUriに対してのみ機能します。
この API は、特に使用の結果として返される URI を開くときに、システムの安定性を確保するためにメディア URI を開くときに ContentResolver#openFileDescriptor(Uri, String, CancellationSignal) よりも優先されます MediaStore#ACTION_PICK_IMAGES
このページの一部は、によって作成および共有され、に記載されている条件に従って使用される作業に基づく変更です。