I am trying to start the add contacts function from my application. I know how to trigger contact activity, but so far it’s not known how to launch “Add Contact”. I'm starting to learn Android, please be specific. Thanks.
Intent intent = new Intent( ContactsContract.Intents.SHOW_OR_CREATE_CONTACT, Uri.parse("tel:" + phoneNumber)); intent.putExtra(ContactsContract.Intents.EXTRA_FORCE_CREATE, true); startActivity(intent);
Try this code:
Intent i = new Intent(Intent.ACTION_INSERT_OR_EDIT); i.setType(ContactsContract.Contacts.CONTENT_ITEM_TYPE); startActivity(i);
Source: https://habr.com/ru/post/1380320/More articles:Convert between a double and byte array to pass through the ZigBee API? - c ++ASP.NET with jQuery popup dialog: how to send message to close dialog box - jqueryJavaScript error says “confirmation is not a function” - jqueryEclipse debugging: continue to work after return? - javaWhat kind of semantic markup should be used to create breadcrumbs? - htmlFunction start at session expiration? - phpusing update statement in sqlite in android - androidAndroid TableLayout vs GridView vs Other? - androidPython stack iteration, best practice - pythonInvisible zoom controls in webview - androidAll Articles