diff options
| author | Bananeweizen <bananeweizen@gmx.de> | 2014-01-04 13:08:15 +0100 |
|---|---|---|
| committer | Bananeweizen <bananeweizen@gmx.de> | 2014-01-04 13:08:15 +0100 |
| commit | 01de707ee0f6f47cfcb576f0e82e0c65ed8e418a (patch) | |
| tree | 96ebc206fa71d1864b32107685f2754bdcde3c69 /main/src/cgeo/contacts | |
| parent | fd2664c70770a1670330b488eb01b3a976a06433 (diff) | |
| download | cgeo-01de707ee0f6f47cfcb576f0e82e0c65ed8e418a.zip cgeo-01de707ee0f6f47cfcb576f0e82e0c65ed8e418a.tar.gz cgeo-01de707ee0f6f47cfcb576f0e82e0c65ed8e418a.tar.bz2 | |
refactoring: make user actions depend on the connector
This enables the contacts addon and search by user/owner for all user
names (independent of the kind of cache). Of course, search by
user/owner still only works for GC, so one cannot find EC owner caches
that way.
Diffstat (limited to 'main/src/cgeo/contacts')
| -rw-r--r-- | main/src/cgeo/contacts/ContactsAddon.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/main/src/cgeo/contacts/ContactsAddon.java b/main/src/cgeo/contacts/ContactsAddon.java new file mode 100644 index 0000000..f2498ea --- /dev/null +++ b/main/src/cgeo/contacts/ContactsAddon.java @@ -0,0 +1,24 @@ +package cgeo.contacts; + +import cgeo.geocaching.network.Parameters; +import cgeo.geocaching.utils.ProcessUtils; + +import android.app.Activity; +import android.content.Intent; +import android.net.Uri; + +public class ContactsAddon { + public static void openContactCard(Activity context, String userName) { + final Parameters params = new Parameters( + IContacts.PARAM_NAME, userName + ); + + context.startActivity(new Intent(IContacts.INTENT, + Uri.parse(IContacts.URI_SCHEME + "://" + IContacts.URI_HOST + "?" + params.toString()))); + } + + public static boolean isAvailable() { + return ProcessUtils.isIntentAvailable(IContacts.INTENT, Uri.parse(IContacts.URI_SCHEME + "://" + IContacts.URI_HOST)); + } + +} |
