Take a look at this sample app. It runs on every version of the SDK starting from Cupcake and calls the right API on each platform.
http://developer.android.com/resources/samples/BusinessCard/index.html I hope this helps, - Dmitri On Thu, Feb 25, 2010 at 5:26 PM, jylc08 <[email protected]> wrote: > > > My Android app has a ContactsList activity in which I simply display a > list of contacts that are on the phone. > > Only recently I noticed that my activity only displays contacts synced > with my main Google account. I have two Google accounts on my test > phone and ideally I want my activity to display the contacts for both > accounts (or multiple accounts). > > How do I query across multiple accounts? > > This is how I setup my cursor currently > > Cursor c = getContentResolver().query(Phones.CONTENT_URI, null, > queryString, null, Phones.DISPLAY_NAME + " ASC"); > startManagingCursor(c); > > On a side note, I know android.provider.contacts.phones is deprecated > and I should be using ContactsContract but I need to build my app with > SDK 1.5, which doesn't have ContactsContract > > -- > 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]<android-developers%[email protected]> > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- 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

