I want to open Contacts pick activity from my application with search field should be filled programmatically. Can anyone suggest what URI shoud i use or anything to put in intent's extra?
private static final int PICK_CONTACT_SUBACTIVITY = 2; private void startContactActivity() { Uri uri = Uri.parse("content://contacts/people"); // Here in this normally we pass number e.g. Uri.encode("987") but i want to pass name as filter is it possible? // I have also tried //uri = Uri.withAppendedPath(android.provider.ContactsContract.Contacts.CONTENT_FILTER_URI, Uri.encode("pra")); //uri = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, Uri.encode("pra")); uri = Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_FILTER_URI, Uri.encode("pra")); Intent intent = new Intent(Intent.ACTION_PICK, uri); startActivityForResult(intent, PICK_CONTACT_SUBACTIVITY); }
Can anyone suggest how can i achieve this?