Access to Contact list
Firstly we need to ask standard permission to Contacts, this is common pattern something like this
Than we can use ContactsContract class to load all contact synchronously one-by-one to Contact Adapter and show contacts in RecycledView.
In reality this activity more sophisticated. Because Android Emulator has no embedded contacts we need generate Test contact. I use Application level parameters in configuration and generate Fake Contact for debugging.
Than, when contact clicked, data packet to Parcelable class and pass to next Activity with Intent class Pass data to new form with Intent and getParcelableExtra
This is code of my Contact activity.
AndroidMosaic context:
Comments (
)
)
Link to this page:
http://www.vb-net.com/AndroidMosaic/Index09.htm
|
|