aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/utils/ProcessUtils.java
diff options
context:
space:
mode:
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)));
}
}