Sdílet prostřednictvím


ContentProvider.GetTypeAnonymous(Uri) Method

Definition

Implement this to handle requests for MIME type of URIs, that does not need to reveal any internal information which should be protected by any permission.

[Android.Runtime.Register("getTypeAnonymous", "(Landroid/net/Uri;)Ljava/lang/String;", "GetGetTypeAnonymous_Landroid_net_Uri_Handler", ApiSince=34)]
public virtual string? GetTypeAnonymous (Android.Net.Uri uri);
[<Android.Runtime.Register("getTypeAnonymous", "(Landroid/net/Uri;)Ljava/lang/String;", "GetGetTypeAnonymous_Landroid_net_Uri_Handler", ApiSince=34)>]
abstract member GetTypeAnonymous : Android.Net.Uri -> string
override this.GetTypeAnonymous : Android.Net.Uri -> string

Parameters

uri
Uri

the URI to query.

Returns

a MIME type string, or null if type needs to be protected.

Attributes

Remarks

Implement this to handle requests for MIME type of URIs, that does not need to reveal any internal information which should be protected by any permission.

If your mime type reveals details that should be protected, then you should protect those by implementing those in #getType, and in this function, only return types of URIs which can be obtained by anyone without any access.

Implementing ths function will make sure #getType is protected by readPermission. This function by default works as the #getType

Java documentation for android.content.ContentProvider.getTypeAnonymous(android.net.Uri).

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