aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/contacts/ContactsAddon.java
blob: f2498ea95b36dc8d47cb2db00da8840c8e9e2581 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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));
    }

}