Insert a new contact intent

后端 未结 9 1007
陌清茗
陌清茗 2020-11-30 23:02

For one of my apps, I need the user to select one of his existing contacts or to create a new one. Picking one is clearly easy to do with the following code:



        
9条回答
  •  暖寄归人
    2020-11-30 23:46

    In Xamarin.forms and Xamarin.Android c#.

    Android.Content.Intent intent = new  
    Android.Content.Intent(Android.Content.Intent.ActionInsert);
    intent.SetType(Android.Provider.ContactsContract.Contacts.ContentType);
    intent.PutExtra(Android.Provider.ContactsContract.Intents.ExtraForceCreate, 
    true);
    StartActivity(intent);
    

提交回复
热议问题