public final class IntentHelper
extends java.lang.Object
android.content.Intent.| Modifier and Type | Method and Description |
|---|---|
static java.util.List |
getMimeTypes(Intent intent,
Context context)
Retrieves the available mime-types from the Intent.
|
static java.lang.String |
getSourceAppName(Intent intent,
Context context)
Retrieve the name of the app from which the Intent was received.
|
static Uri |
getUri(Intent intent)
Retrieves the Uri from the Intent.
|
static java.util.List |
getUris(Intent intent) |
static boolean |
hasMimeType(Intent intent,
Context context,
java.lang.String mimeType)
Check whether the Intent has a specific mime-type.
|
static boolean |
hasMimeTypeWithPrefix(Intent intent,
Context context,
java.lang.String prefix)
Check whether the Intent has a mime-type starting the provided prefix.
|
static boolean |
hasMimeTypeWithPrefix(Uri uri,
Context context,
java.lang.String prefix) |
static boolean |
hasMultipleUris(Intent intent) |
public static Uri getUri(Intent intent)
intent - an Intentpublic static java.util.List getMimeTypes(Intent intent,
Context context)
intent - an Intentcontext - Android contextjava.lang.IllegalArgumentException - if the Intent contains no Uripublic static java.util.List getUris(Intent intent)
public static boolean hasMimeType(Intent intent,
Context context,
java.lang.String mimeType)
intent - an Intentcontext - Android contextmimeType - required mime-type stringtrue, if the Intent has the mime-type or falsejava.lang.IllegalArgumentException - if the Intent contains no Uripublic static boolean hasMimeTypeWithPrefix(Intent intent,
Context context,
java.lang.String prefix)
intent - an Intentcontext - Android contextprefix - mime-type prefixtrue, if the Intent has a mime-type starting with the prefix or falsejava.lang.IllegalArgumentException - if the Intent contains no Uripublic static boolean hasMimeTypeWithPrefix(Uri uri,
Context context,
java.lang.String prefix)
public static java.lang.String getSourceAppName(Intent intent,
Context context)
intent - an Intentcontext - Android contextjava.lang.IllegalArgumentException - if the Intent contains no Uripublic static boolean hasMultipleUris(Intent intent)