public enum UrlAction extends java.lang.Enum<UrlAction>
UrlAction
describes the different kinds of actions for URLs that UrlHandler
can
potentially perform and how to match against each URL.Enum Constant and Description |
---|
FOLLOW_DEEP_LINK |
FOLLOW_DEEP_LINK_WITH_FALLBACK |
HANDLE_MOPUB_SCHEME
NOTE: The order in which these are defined determines the priority when matching URLs!
If a URL matches multiple Url Actions, it will be handled by the one that appears first in
this enum (see
UrlHandler.handleUrl(Context, String) ). |
HANDLE_PHONE_SCHEME |
HANDLE_SHARE_TWEET
This handles tweet sharing via the chooser dialog.
|
IGNORE_ABOUT_SCHEME |
NOOP |
OPEN_APP_MARKET |
OPEN_IN_APP_BROWSER |
OPEN_NATIVE_BROWSER |
Modifier and Type | Method and Description |
---|---|
void |
handleUrl(UrlHandler urlHandler,
android.content.Context context,
android.net.Uri destinationUri,
boolean fromUserInteraction) |
protected abstract void |
performAction(android.content.Context context,
android.net.Uri uri,
UrlHandler urlHandler) |
abstract boolean |
shouldTryHandlingUrl(android.net.Uri uri) |
static UrlAction |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static UrlAction[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final UrlAction HANDLE_MOPUB_SCHEME
UrlHandler.handleUrl(Context, String)
).
Each UrlAction includes its ordinal in a comment as a reminder of this fact.public static final UrlAction IGNORE_ABOUT_SCHEME
public static final UrlAction HANDLE_PHONE_SCHEME
public static final UrlAction OPEN_NATIVE_BROWSER
public static final UrlAction OPEN_APP_MARKET
public static final UrlAction OPEN_IN_APP_BROWSER
public static final UrlAction HANDLE_SHARE_TWEET
Intents.intentForShareTweet(Uri)
for more details.public static final UrlAction FOLLOW_DEEP_LINK_WITH_FALLBACK
public static final UrlAction FOLLOW_DEEP_LINK
public static final UrlAction NOOP
public static UrlAction[] values()
for (UrlAction c : UrlAction.values()) System.out.println(c);
public static UrlAction valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic void handleUrl(UrlHandler urlHandler, android.content.Context context, android.net.Uri destinationUri, boolean fromUserInteraction) throws IntentNotResolvableException
IntentNotResolvableException
public abstract boolean shouldTryHandlingUrl(android.net.Uri uri)
protected abstract void performAction(android.content.Context context, android.net.Uri uri, UrlHandler urlHandler) throws IntentNotResolvableException
IntentNotResolvableException