aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/utils/ProcessUtils.java
diff options
context:
space:
mode:
authorBananeweizen <bananeweizen@gmx.de>2015-01-31 12:19:09 +0100
committerBananeweizen <bananeweizen@gmx.de>2015-01-31 12:19:09 +0100
commit7b5594eca359e122ac431aa63c39c35bbfcf493a (patch)
treeb33c7b25c21ad864cf012a2519d3778ec7ccd0f5 /main/src/cgeo/geocaching/utils/ProcessUtils.java
parentefa3d1c65063f42cf961158d1c907daf03a1c97c (diff)
downloadcgeo-7b5594eca359e122ac431aa63c39c35bbfcf493a.zip
cgeo-7b5594eca359e122ac431aa63c39c35bbfcf493a.tar.gz
cgeo-7b5594eca359e122ac431aa63c39c35bbfcf493a.tar.bz2
fall back to browser if market is not available
Diffstat (limited to 'main/src/cgeo/geocaching/utils/ProcessUtils.java')
-rw-r--r--main/src/cgeo/geocaching/utils/ProcessUtils.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/main/src/cgeo/geocaching/utils/ProcessUtils.java b/main/src/cgeo/geocaching/utils/ProcessUtils.java
index 9642794..37a1edf 100644
--- a/main/src/cgeo/geocaching/utils/ProcessUtils.java
+++ b/main/src/cgeo/geocaching/utils/ProcessUtils.java
@@ -108,15 +108,17 @@ public final class ProcessUtils {
}
@SuppressWarnings("deprecation")
- public static void openMarket(final Activity activity, final String url) {
+ public static void openMarket(final Activity activity, @NonNull final String packageName) {
try {
// allow also opening pure http URLs in addition to market packages
+ final String url = "market://details?id=" + packageName;
final Intent marketIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
marketIntent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET | Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
activity.startActivity(marketIntent);
} catch (final RuntimeException ignored) {
- // market not available in standard emulator
+ // market not available, fall back to browser
+ activity.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://play.google.com/store/apps/details?id=" + packageName)));
}
}