Android Contact Create getCreateNewContactIntent(QRCodeContact qrc)

Here you can find the source of getCreateNewContactIntent(QRCodeContact qrc)

Description

Forms and returns an intent to create new contact.

Parameter

Parameter Description
qrc QRCodeContact

Return

the intent

Declaration

public static Intent getCreateNewContactIntent(QRCodeContact qrc) 

Method Source Code

import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.provider.ContactsContract;
import com.android.qrcodecontact.entity.QRCodeContact;
import java.io.File;

public class Main{
    /**//from w w w  .  ja va 2  s  .  c  o  m
     * Forms and returns an intent to create new contact.
     *
     * @param qrc QRCodeContact
     * @return the intent
     */
    public static Intent getCreateNewContactIntent(QRCodeContact qrc) {
        Intent i = new Intent(Intent.ACTION_INSERT);
        i.setType(ContactsContract.Contacts.CONTENT_TYPE);
        i.putExtra(ContactsContract.Intents.Insert.NAME,
                qrc.getContact_Name());
        i.putExtra(ContactsContract.Intents.Insert.PHONE,
                qrc.getContact_Phone());
        return i;
    }
}