I am able to make a call using,
Intent intent = new Intent(Intent.ACTION_CALL);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setData(Uri.parse("tel:" + "911"));
startActivity(intent);
But I am required to update emergency contact in Android programatically from my app. Is there any way to update emergency contact from any app other than from default contact app? By update I mean add, delete and modify any emergency contact.
Here is one post, where they discussed how to update contact, but in my case, I need to update the emergency contact not a normal contact.
There is no way to modify emergency information until now. However any app can ask user to edit info using ACTION_VIEW or ACTION_EDIT.
Intent intent = new Intent(Intent.ACTION_VIEW, ContactsContract.Profile.CONTENT_URI);
MainActivity.this.startActivity(intent);
Related
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)
Android: How to show a list of dialer app installed on my device instead of directly calling default dialer
Intent intent = new Intent(Intent.ACTION_CALL);
startActivity(intent);
permission -
<uses-permission android:name="android.permission.CALL_PHONE" />
So with this code the deault dialer app gets called. I want the behavior where Android suggest me the list of apps that could be used for calling feature.
You can not show list of dialer while using ACTION_CALL intent.
You need a special permission because the ACTION_CALL is a protected action, allow you to call a phone number directly, with no interaction from the user.
You can make Intent chooser for ACTION_DIAL intent which allows you to show list of apps which has dialer. You can use this code.
final Intent intent = new Intent();
intent.setAction(Intent.ACTION_DIAL);
intent.setData(Uri.fromParts("tel", "123456", null));
startActivity(Intent.createChooser(intent, ""), REQUEST_CODE));
I hope it helps!
Is it possible to access the dialer of android (mobile phone) from android app. Say if a user enters 001 in the app following by a telephone number, app should make the dialer of android(Mobile Phone) dial the number after 001...?
You can send an Intent which will open de phone dialer with supplied phonenumber.
http://developer.android.com/reference/android/content/Intent.html#ACTION_DIAL
String url = "tel:1234";
Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse(url));
Don't forget to add the permission to your manifest
<uses-permission android:name="android.permission.CALL_PHONE"></uses-permission>
You could try to send Intent with this action Intent.ACTION_DIAL(android.intent.action.DIAL) to see if it works.
ACTION_DIAL tel:123 -- Display the phone dialler with the given number filled in.
Use below code hope it helps
Intent sIntent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:"+00189899989));
startActivity(sIntent);
My question is that from our application can we go to the Default SMS Screen/Phonebook
For example :- I create tabbar with three tab (Inbox,Phonebook,Group).To press Inbox I want to go the default SMS screen which is provided by Android or To press Phonebook I want to go the phonebook screen which is provided by Android.
Is this possible?
Thanks
For PhoneBook you can startActivity with intent ACTION_VIEW;
Intent intent = new Intent(Intent.ACTION_VIEW, ContactsContract.Contacts.CONTENT_URI);
startActivity(intent);
For inbox see this today's answer how can i read inbox in android mobile?
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.