How can I launch the 'Add Contact' activity in android

后端 未结 8 646
感情败类
感情败类 2020-11-30 00:15

Can you please tell me how to launch the Add Contact\' activity in android? Thank you.

8条回答
  •  遥遥无期
    2020-11-30 00:28

    If you have a phone no and want to save it in your own application then use this code it will move you to the "create contact" page of the default contact app.

      Intent addContactIntent = new Intent(Intent.ACTION_INSERT);
      addContactIntent.setType(ContactsContract.Contacts.CONTENT_TYPE);
      addContactIntent.putExtra(ContactsContract.Intents.Insert.PHONE,phnno.getText().toString());
      startActivity(addContactIntent);
    

提交回复
热议问题