Android Contact Search processContactsResult(Activity activity, Intent intent)

Here you can find the source of processContactsResult(Activity activity, Intent intent)

Description

process Contacts Result

Declaration

public static String processContactsResult(Activity activity,
            Intent intent) 

Method Source Code

//package com.java2s;
import android.app.Activity;

import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.provider.Contacts.People;

public class Main {
    public static String processContactsResult(Activity activity,
            Intent intent) {//ww w .  j a v a2s .co  m
        String result = null;

        Uri contactData = intent.getData();
        Cursor c = activity.managedQuery(contactData, null, null, null,
                null);
        if (c.moveToFirst())
            result = c.getString(c.getColumnIndexOrThrow(People.NUMBER));
        c.close();

        return result;
    }
}

Related

  1. isContactNameByNumberExist(Context context, String number)