The code you posted doesn't query anything. It's retrieving a value from a specific row and column in a cursor. To make the other numbers be part of your cursor, specify that you want those numbers by including them in the projection you pass to the query() call. To retrieve them from the cursor, just call getString() for the different columns.
On Tue, Jun 16, 2009 at 10:13 AM, Meryl Silverburgh < [email protected]> wrote: > > Hi, > > I have the following code which queries 1 number of a contact. It works. > But how can I change it so that I can query multiple numbers (work, > mobile, home) for the same contact and the type of each number? > > int phoneColumnIndex = cursor.getColumnIndex(People.NUMBER); > if (phoneColumnIndex != -1) { > > String phoneNumber = > cursor.getString(phoneColumnIndex); > > System.out.println (" phoneNumber:" + > phoneNumber); > } > } > > Thank you. > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

