From d67b8de83c5408afd770d71161c0df94ffaaec01 Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Tue, 8 Jul 2014 21:41:35 +0200 Subject: Use long urls when opening a cache in the browser (#3886) This lets the user set cgeo as the handler for the coord.info/ URL while the browser can handle the ones in geocaching.com. --- main/src/cgeo/geocaching/Geocache.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'main/src') diff --git a/main/src/cgeo/geocaching/Geocache.java b/main/src/cgeo/geocaching/Geocache.java index 91ab6da..8e7f419 100644 --- a/main/src/cgeo/geocaching/Geocache.java +++ b/main/src/cgeo/geocaching/Geocache.java @@ -496,7 +496,7 @@ public class Geocache implements ICache, IWaypoint { } public void openInBrowser(final Activity fromActivity) { - final Intent viewIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(getUrl())); + final Intent viewIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(getLongUrl())); // Check if cgeo is the default, show the chooser to let the user choose a browser if (viewIntent.resolveActivity(fromActivity.getPackageManager()).getPackageName().equals(fromActivity.getPackageName())) { @@ -741,6 +741,10 @@ public class Geocache implements ICache, IWaypoint { return getConnector().getCacheUrl(this); } + public String getLongUrl() { + return getConnector().getLongCacheUrl(this); + } + public String getCgeoUrl() { return getConnector().getCacheUrl(this); } public boolean supportsGCVote() { -- cgit v1.1