FMX.AddressBook.TAddressBookContacts

From RAD Studio API Documentation
Jump to: navigation, search

System.Generics.Collections.TObjectListSystem.Generics.Collections.TListSystem.Generics.Collections.TEnumerableSystem.TObjectTAddressBookContacts

Delphi

TAddressBookContacts = class(TObjectList<TAddressBookContact>);

C++

class PASCALIMPLEMENTATION TAddressBookContacts : public System::Generics::Collections::TObjectList__1<TAddressBookContact*>

Properties

Type Visibility Source Unit Parent
class public
FMX.AddressBook.pas
FMX.AddressBook.hpp
FMX.AddressBook FMX.AddressBook

Description

Represents an ordered list of contacts, accessible by an index.

Examples

To clarify, consider the following examples. These code snippets illustrate how to fetch all contacts from the default source in a device Address Book.

Note: Before calling the AllContacts method, you should explicitly initialize an instance of the AContacts object using the TAdressBookContacts.Create method (for Delphi) or new (for C++Builder).

Delphi:

var
  Contacts: TAddressBookContacts;
begin
  Contacts := TAddressBookContacts.Create;
  try
    // Get all contacts from the default source
    AddressBook1.AllContacts(AddressBook1.DefaultSource, Contacts);
    // do something with contacts
  finally
    Contacts.Free;
  end;
end;

C++Builder:

{
TAddressBookContacts *Contacts;
	Contacts = new TAddressBookContacts();
	__try {
                // Get all contacts from the default source
		AddressBook1->AllContacts(AddressBook1->DefaultSource(), Contacts);
		// do something with contacts
	}
	__finally {
		Contacts->Free();
	}
}

For more information and samples, see Mobile Tutorial: Using an Address Book Component (iOS and Android).

See Also