I want the user to be able to send an sms by either dialing a phone number himself or picking it up from a contact list.
I know that I could easily achieve it, querying all the contacts and providing a TextView
to either filtering the contacts or dialing a number but my question his aimed to simplify the code.
On the default lollipop Messenger app, if the user clicks the "+" plus button, he can do exactly what I've described before: here's a screenshot of what I mean.
On Android, there is a pretty similar function which I am able to reproduce using this code:
Intent intent = new Intent(Intent.ACTION_PICK, ContactsContract.CommonDataKinds.Phone.CONTENT_URI);
startActivityForResult(intent, 1);
However, it only let the user pick up an already existing contact and eventually extracts a phone number from it.
Shortly my question is:
Is there any way to reproduce the default Messenger behavior by using Intent
s?
Thanks in advance.