aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2014-07-08 21:41:35 +0200
committerSamuel Tardieu <sam@rfc1149.net>2014-07-08 21:43:32 +0200
commitd67b8de83c5408afd770d71161c0df94ffaaec01 (patch)
tree5a2077e709cf935a011d266213d9d604cf094169
parent986217740a3c91b37fb1a7cc6efa52a2350d4b5a (diff)
downloadcgeo-d67b8de83c5408afd770d71161c0df94ffaaec01.zip
cgeo-d67b8de83c5408afd770d71161c0df94ffaaec01.tar.gz
cgeo-d67b8de83c5408afd770d71161c0df94ffaaec01.tar.bz2
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.
-rw-r--r--main/src/cgeo/geocaching/Geocache.java6
1 files changed, 5 insertions, 1 deletions
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() {