diff options
author | Martin Fietz <Martin.Fietz@gmail.com> | 2016-06-10 19:57:38 +0200 |
---|---|---|
committer | Martin Fietz <Martin.Fietz@gmail.com> | 2016-06-10 19:57:38 +0200 |
commit | ce2125e647a03e27abd16d4098f7acdfe328c1b4 (patch) | |
tree | 19edabc48034f304dc141a98e70969e96205ed7f /core/src | |
parent | a7a204368268502c175466b3fbe08baa0f71e439 (diff) | |
download | AntennaPod-ce2125e647a03e27abd16d4098f7acdfe328c1b4.zip |
Check if there is an exported activity for the intent
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/util/IntentUtils.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/IntentUtils.java b/core/src/main/java/de/danoeh/antennapod/core/util/IntentUtils.java index 2d5a6e5a1..1571b71c2 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/IntentUtils.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/IntentUtils.java @@ -9,10 +9,18 @@ import java.util.List; public class IntentUtils { + /* + * Checks if there is at least one exported activity that can be performed for the intent + */ public static boolean isCallable(final Context context, final Intent intent) { List<ResolveInfo> list = context.getPackageManager().queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY); - return list.size() > 0; + for(ResolveInfo info : list) { + if(info.activityInfo.exported) { + return true; + } + } + return false; } } |