Search code examples
androidandroid-contactslockscreenandroid-dialer

Is it possible to update emergency contact programatically?


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.


Solution

  • 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);