diff options
Diffstat (limited to 'main/src/cgeo')
-rw-r--r-- | main/src/cgeo/geocaching/apps/AbstractApp.java | 22 | ||||
-rw-r--r-- | main/src/cgeo/geocaching/cgeo.java | 4 |
2 files changed, 4 insertions, 22 deletions
diff --git a/main/src/cgeo/geocaching/apps/AbstractApp.java b/main/src/cgeo/geocaching/apps/AbstractApp.java index 0c38b02..1161a05 100644 --- a/main/src/cgeo/geocaching/apps/AbstractApp.java +++ b/main/src/cgeo/geocaching/apps/AbstractApp.java @@ -1,15 +1,11 @@ package cgeo.geocaching.apps; +import cgeo.geocaching.cgeo; import cgeo.geocaching.cgeoapplication; -import org.apache.commons.collections.CollectionUtils; - import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; -import android.content.pm.ResolveInfo; - -import java.util.List; public abstract class AbstractApp implements App { @@ -48,21 +44,7 @@ public abstract class AbstractApp implements App { if (getLaunchIntent(context) != null) { return true; } - return isIntentAvailable(context, intent); - } - - private static boolean isIntentAvailable(Context context, String action) { - final Intent intent = new Intent(action); - - return isIntentAvailable(context, intent); - } - - protected static boolean isIntentAvailable(Context context, Intent intent) { - final PackageManager packageManager = context.getPackageManager(); - final List<ResolveInfo> list = packageManager.queryIntentActivities( - intent, PackageManager.MATCH_DEFAULT_ONLY); - - return CollectionUtils.isNotEmpty(list); + return cgeo.isIntentAvailable(context, intent); } @Override diff --git a/main/src/cgeo/geocaching/cgeo.java b/main/src/cgeo/geocaching/cgeo.java index ff47b15..4de8e50 100644 --- a/main/src/cgeo/geocaching/cgeo.java +++ b/main/src/cgeo/geocaching/cgeo.java @@ -262,12 +262,12 @@ public class cgeo extends AbstractActivity { return true; } - private static boolean isIntentAvailable(Context context, String intent) { + public static boolean isIntentAvailable(Context context, String intent) { final PackageManager packageManager = context.getPackageManager(); final List<ResolveInfo> list = packageManager.queryIntentActivities( new Intent(intent), PackageManager.MATCH_DEFAULT_ONLY); - return list.size() > 0; + return CollectionUtils.isNotEmpty(list); } @Override |