ListView et Contact - Android2eeAndroid2ee formation expert android
× GUI

ListView et Contact

More
11 years 10 months ago #28 by mseguy
As tu bien ajouter dans ton manifest la demande de permission d'accès au contact?
Quel est la version du sdk que tu utilises?
Tu fais ça pour afficher la valeur du string
Cursor people = getContentResolver().query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null);
while (people.moveToNext()) {
int nameFieldColumnIndex = people.getColumnIndex(PhoneLookup.DISPLAY_NAME);
String contact = people.getString(nameFieldColumnIndex);
Log.v("TAG", "valeur du string:"+contact);
}
people.close();

Et tu vas voir dans ta vue LogCat ton log, c'est bien ça?

Mathias Séguy
This email address is being protected from spambots. You need JavaScript enabled to view it.
Auteur Android2ee.com
Docteur en Mathématiques Fondamentales
Directeur Technique & Avant-vente
Expert Technique de l'Agence Nationale de la Recherche
Rédacteur sur Developpez.com

Please Log in or Create an account to join the conversation.

Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Affichage
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline