Option to create new contact from pick list - android

My application wants a functionality of picking a contact from the
phone contact, I have achieved this using the following intent
Intent intent = new Intent(Intent.ACTION_PICK, People.CONTENT_URI);
startActivityForResult(intent, 001);
How do i start pick contact activity with an option to create a new contact from the pick list, similar to the one which is available in inbuilt Launcher appliation.

Perhaps passing in one of the extras listed in Contacts.Intents.UI. I'm mostly looking at LIST_ALL_CONTACTS_ACTION and LIST_DEFAULT.

Related

Reading gallery folders using Implicit intent

I am implementing an android app, which will synchronize images from selected folder to server (as Google Photo). I want that user will select folder by clicking on button. I can achieve this by creating my own view. But, if implicit intent can any implicit intent action by which I can show user only images folder from device?
Try,
Intent intent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
startActivityForResult(intent, 100);
change EXTERNAL_CONTENT_URI constant accordingly.

Android open Contacts app (not choose a contact)

I want to give the user possibility to open Contacts app from my app, so he can edit them, export etc. What I DON'T WANT is a contact picker where the user selects a contact. I need only to somehow open the Contacts app from my app. How Can I do it ? Intent ?
The following snippet will do what you want .
Intent intent = new Intent(Intent.ACTION_VIEW, ContactsContract.Contacts.CONTENT_URI);
startActivity(intent);
This should work as expected.
Intent intent = new Intent();
intent.setComponent(new ComponentName(
"com.android.contacts"
,"com.android.contacts.DialtactsContactsEntryActivity");
startActivity(intent)

Set out filter for Action_Pick Intent

I am using ACTION_PICK intent.
Intent intent = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI);
startActivityForResult(intent, REQUEST_CONTACT);
However, I want to send a filter such that the list does not shows any contact number that does not have any name.
Similarly I want to filter out to show only those contacts that have got a number specific to a country code. For e.g. show only contacts that starts with 61.
Anything possible here?

Ask Contact Picker to show a subset of contacts

I can use this code to trigger a Contact Picker to show a list of contacts so that I can pick one of them.
Intent i=new Intent(Intent.ACTION_PICK, Contacts.CONTENT_URI);
startActivityForResult(i, PICK_REQUEST);
However, how can I send my request to show part of contacts, such as the name beginning by "A" only?

Open contact list to pick contact, or add a new one

In my application I need to pick a contact using the default contact application. I do that using:
Intent intent = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI);
startActivityForResult(intent, PICK_CONTACT);
But i'm missing the "Create New" button, which is there on the top. How can I get it?
You can't, this is not possible.
The only way is to create yourself the "ContactPickerActivity" so you can add what you want in it and for example your "Add a contact" button.
In your sample folder (samples/android-XX/ApiDemos/src/com/example/android/apis/app/LoaderCursor) you have a great exemple of how to achieve it.

Categories

Resources