Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import android.content.Intent;

import android.provider.Contacts.Intents;
import android.provider.ContactsContract.Contacts;

public class Main {
    /**
     * @brief      Get the intent to add email address to existed contact.
     *
     * @par        Sync (or) Async:
     * This is a Synchronous function.
     *
     * @param [IN] email    email address.\n
     * 
     * @return     
     *
     * @author     daiping.zhao
     * @since      1.0.0.0
     * @version    1.0.0.0
     * @par        Prospective Clients:
     * External Classes
     */
    public static Intent doAddEmaliToExistContact(String email) {
        Intent newIntent = new Intent(Intent.ACTION_INSERT_OR_EDIT, Contacts.CONTENT_URI);
        newIntent.setType(Contacts.CONTENT_ITEM_TYPE);
        newIntent.putExtra(Intents.Insert.EMAIL, email);
        return newIntent;
    }
}