IntentUriType Enum
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Enumerates values returned by the UriIntentScheme, None, and Scheme members and taken as a parameter of the F:Android.Content.Intent.ParseUri, and F:Android.Content.Intent.ToUri members.
This enumeration supports a bitwise combination of its member values.
[System.Flags]
public enum IntentUriType
[<System.Flags>]
type IntentUriType =
- Inheritance
-
IntentUriType
- Attributes
Fields
| Name | Value | Description |
|---|---|---|
| None | 0 | Specifies that no URI encoding flags are set. |
| Scheme | 1 | Flag for use with toUri(int) and parseUri(String, int) : the URI string always has the "intent:" scheme. This syntax can be used when you want to later disambiguate between URIs that are intended to describe an Intent vs. all others that should be treated as raw URIs. When used with parseUri(String, int) , any other scheme will result in a generic VIEW action for that raw URI. |
| AndroidAppScheme | 2 | Flag for use with toUri(int) and parseUri(String, int) : the URI string always has the "android-app:" scheme. This is a variation of URI_INTENT_SCHEME whose format is simpler for the case of an http/https URI being delivered to a specific package name. The format is: android - app : //{package_id}[/{scheme}[/{host}[/{path}]]][#Intent;{...}] In this scheme, only the package_id is required. If you include a host, you must also include a scheme; including a path also requires both a host and a scheme. The final #Intent; fragment can be used without a scheme, host, or path. Note that this can not be used with intents that have a setSelector(Intent) , since the base intent will always have an explicit package name. Some examples of how this scheme maps to Intent objects: URI Intent android-app://com.example.app Action: ACTION_MAIN Package: com.example.app android-app://com.example.app/http/example.com Action: ACTION_VIEW Data: http://example.com/ Package: com.example.app android-app://com.example.app/http/example.com/foo?1234 Action: ACTION_VIEW Data: http://example.com/foo?1234 Package: com.example.app android-app://com.example.app/ #Intent;action=com.example.MY_ACTION;end Action: com.example.MY_ACTION Package: com.example.app android-app://com.example.app/http/example.com/foo?1234 #Intent;action=com.example.MY_ACTION;end Action: com.example.MY_ACTION Data: http://example.com/foo?1234 Package: com.example.app android-app://com.example.app/ #Intent;action=com.example.MY_ACTION; i.some_int=100;S.some_str=hello;end Action: com.example.MY_ACTION Package: com.example.app Extras: some_int=(int)100 some_str=(String)hello |
| AllowUnsafe | 4 | Flag for use with toUri(int) and parseUri(String, int) : allow parsing of unsafe information. In particular, the flags FLAG_GRANT_READ_URI_PERMISSION , FLAG_GRANT_WRITE_URI_PERMISSION , FLAG_GRANT_PERSISTABLE_URI_PERMISSION , and FLAG_GRANT_PREFIX_URI_PERMISSION flags can be set, so that the generated Intent can cause unexpected data access to happen. If you do not trust the source of the URI being parsed, you should still do further processing to protect yourself from it. In particular, when using it to start an activity you should usually add in CATEGORY_BROWSABLE to limit the activities that can handle it. |
Remarks
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.