Hi all, I have been reworking everything for my app and have forgotten
how to access contact phone numbers (which is odd because I believe I am
doing the same thing I did last time I did this). Anyway, any help would
be greatly appreciated. I haven't been able to get any responces for the
last few days and I could really use some pointers. Thanks.


  String name,hasNumber,id;
        ArrayList<String> numbers = new ArrayList<String>();
        while(c.moveToNext()){
                name =
c.getString(c.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME));
                id =
c.getString(c.getColumnIndex(ContactsContract.Contacts._ID));
                hasNumber =
c.getString(c.getColumnIndex(ContactsContract.Contacts.HAS_PHONE_NUMBER));
                if(hasNumber.equals("1")){
                        names.add(name);
                                Cursor pCur =
cr.query(ContactsContract.PhoneLookup.CONTENT_FILTER_URI, null, null,
null, null);
                                while(pCur.moveToNext()){

numbers.add(pCur.getString(pCur.getColumnIndex(ContactsContract.PhoneLookup.NUMBER)));
                                }
                }
        }

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

To unsubscribe, reply using "remove me" as the subject.

Reply via email to