Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.content.Context;
import android.content.Intent;

import android.net.Uri;

import android.provider.ContactsContract;

public class Main {
    public static void openContactInfo(final Context context, final long contactid) {
        final Intent intent = new Intent(Intent.ACTION_VIEW);
        final Uri uri = Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_URI, String.valueOf(contactid));
        intent.setData(uri);
        context.startActivity(intent);
    }
}