我在为Xamarin.Android编译此代码时收到了此消息:
"E:\_MyFiles\Projects\C#\TelegramHack\TelegramHack.csproj" (SignAndroidPackage target) (1) ->
(CoreCompile target) ->
App.cs(53,26): warning CS0618: 'Activity.ManagedQuery(Uri, string[], string, string[], string)' is obsolete: 'deprecated'
[E:\_MyFiles\Projects\C#\**PrivateContent**\**PrivateContent**.csproj]
var ctks = new List<Contact>();
var uri = ContactsContract.CommonDataKinds.Phone.ContentUri;
string[] projection = { ContactsContract.Contacts.InterfaceConsts.Id, ContactsContract.Contacts.InterfaceConsts.DisplayName, ContactsContract.CommonDataKinds.Phone.Number};
var cursor = ManagedQuery(uri, projection, null, null, null);
if (cursor.MoveToFirst ()) {
do {
ctks.Add(new Contact {Name = cursor.GetString(cursor.GetColumnIndex (projection [1])), Number = cursor.GetString(cursor.GetColumnIndex (projection [2]))});
} while (cursor.MoveToNext());
}
return ctks.ToArray();