diff options
| -rw-r--r-- | main/AndroidManifest.xml | 18 | ||||
| -rw-r--r-- | main/src/cgeo/geocaching/CacheDetailActivity.java | 28 |
2 files changed, 40 insertions, 6 deletions
diff --git a/main/AndroidManifest.xml b/main/AndroidManifest.xml index 8f3fce8..95bbe8e 100644 --- a/main/AndroidManifest.xml +++ b/main/AndroidManifest.xml @@ -179,6 +179,24 @@ <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="http" android:host="www.geocaching.com" android:pathPrefix="/seek/cache_details.aspx" /> </intent-filter> + <intent-filter> + <action android:name="android.intent.action.VIEW" /> + <category android:name="android.intent.category.DEFAULT" /> + <category android:name="android.intent.category.BROWSABLE" /> + <data android:scheme="http" android:host="opencaching.de" android:pathPrefix="/OC" /> + </intent-filter> + <intent-filter> + <action android:name="android.intent.action.VIEW" /> + <category android:name="android.intent.category.DEFAULT" /> + <category android:name="android.intent.category.BROWSABLE" /> + <data android:scheme="http" android:host="www.opencaching.de" android:pathPrefix="/OC" /> + </intent-filter> + <intent-filter> + <action android:name="android.intent.action.VIEW" /> + <category android:name="android.intent.category.DEFAULT" /> + <category android:name="android.intent.category.BROWSABLE" /> + <data android:scheme="http" android:host="www.opencaching.de" android:pathPrefix="/viewcache.php" /> + </intent-filter> </activity> <activity android:name="cgeo.geocaching.TrackableActivity" diff --git a/main/src/cgeo/geocaching/CacheDetailActivity.java b/main/src/cgeo/geocaching/CacheDetailActivity.java index 2387622..851a20c 100644 --- a/main/src/cgeo/geocaching/CacheDetailActivity.java +++ b/main/src/cgeo/geocaching/CacheDetailActivity.java @@ -117,7 +117,7 @@ import java.util.regex.Pattern; * e.g. details, description, logs, waypoints, inventory... */ public class CacheDetailActivity extends AbstractViewPagerActivity<CacheDetailActivity.Page> - implements EditNoteDialogListener { + implements EditNoteDialogListener { private static final int MENU_FIELD_COPY = 1; private static final int MENU_FIELD_TRANSLATE = 2; @@ -259,6 +259,23 @@ public class CacheDetailActivity extends AbstractViewPagerActivity<CacheDetailAc finish(); return; } + } else if (uriHost.contains("opencaching.de")) { + if (uriPath != null && uriPath.startsWith("/oc")) { + geocode = uriPath.substring(1).toUpperCase(Locale.US); + } else { + geocode = uri.getQueryParameter("wp"); + if (StringUtils.isNotBlank(geocode)) { + geocode = geocode.toUpperCase(Locale.US); + } else { + showToast(res.getString(R.string.err_detail_open)); + finish(); + return; + } + } + } else { + showToast(res.getString(R.string.err_detail_open)); + finish(); + return; } } @@ -2242,8 +2259,7 @@ public class CacheDetailActivity extends AbstractViewPagerActivity<CacheDetailAc } /** - * Read the position of the cursor pointed to by this holder. - * <br/> + * Read the position of the cursor pointed to by this holder. <br/> * This must be called by the UI thread. * * @return the cursor position @@ -2253,11 +2269,11 @@ public class CacheDetailActivity extends AbstractViewPagerActivity<CacheDetailAc } /** - * Set the position of the cursor pointed to by this holder. - * <br/> + * Set the position of the cursor pointed to by this holder. <br/> * This must be called by the UI thread. * - * @param position the cursor position + * @param position + * the cursor position */ public void setPosition(final int position) { this.position = position; |
