diff options
author | Bananeweizen <bananeweizen@gmx.de> | 2012-05-05 18:53:59 +0200 |
---|---|---|
committer | Bananeweizen <bananeweizen@gmx.de> | 2012-05-05 18:53:59 +0200 |
commit | 9c34c714484eb0791d02f85af396aeeba940d103 (patch) | |
tree | fd722280c9a99a5a795bcdb0ddb5a0eed8e83e89 /main/src/cgeo/geocaching/cgeo.java | |
parent | c3f97cce33fedadf7d33b6d603c31de872ca0a79 (diff) | |
download | cgeo-9c34c714484eb0791d02f85af396aeeba940d103.zip cgeo-9c34c714484eb0791d02f85af396aeeba940d103.tar.gz cgeo-9c34c714484eb0791d02f85af396aeeba940d103.tar.bz2 |
fix #1459: Refactoring navigation menu
Diffstat (limited to 'main/src/cgeo/geocaching/cgeo.java')
-rw-r--r-- | main/src/cgeo/geocaching/cgeo.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/main/src/cgeo/geocaching/cgeo.java b/main/src/cgeo/geocaching/cgeo.java index 3cf5f44..bebc84f 100644 --- a/main/src/cgeo/geocaching/cgeo.java +++ b/main/src/cgeo/geocaching/cgeo.java @@ -18,7 +18,6 @@ import org.apache.commons.lang3.StringUtils; import android.app.AlertDialog; import android.app.SearchManager; -import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.pm.PackageInfo; @@ -277,13 +276,13 @@ public class cgeo extends AbstractActivity { super.onPrepareOptionsMenu(menu); MenuItem item = menu.findItem(MENU_SCAN); if (item != null) { - item.setEnabled(isIntentAvailable(this, SCAN_INTENT)); + item.setEnabled(isIntentAvailable(SCAN_INTENT)); } return true; } - public static boolean isIntentAvailable(Context context, String intent) { - final PackageManager packageManager = context.getPackageManager(); + public static boolean isIntentAvailable(String intent) { + final PackageManager packageManager = cgeoapplication.getInstance().getPackageManager(); final List<ResolveInfo> list = packageManager.queryIntentActivities( new Intent(intent), PackageManager.MATCH_DEFAULT_ONLY); |