質問

I want to get ID of Contact List Application... Currently I am using class named PhoneNumberChooserTask like Chooser Class but I get only Number, Name, FullName. etc.. but how to get ID of that contact?

役に立ちましたか?

解決

Yes It is possible,

Contact c = new Contact();
var Id = c.GetHashCode(); //gives the Id property value.

他のヒント

You have nothing to use the ID for, so it's simply not available to you as a developer. (That means it's not possible.)

According to this answer GetHashCode returns the private property ID of the contact. I have confirmed that in 3 devices (Lumia 620, Lumia 1320, Lumia 925) running Windows Phone 8.1 and it seems to work. I changed contacts details but the ID remained the same.

Uniquely identifying contacts in a Windows Phone Address Book

For Windows Phone 8.1 RT you can just use the contact Id property. GetHashCode() is no longer needed.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top