axel wrote: > Back to the original question: Apps working well with 1.5/1.6 are > broken with 2.0 - exactly the same problem I have. > AFAIK the code below is perfectly valid and should continue to work > with 2.0 - unfortunately it does not. > > String[] returnColumns = new String[] { > Contacts.ContactMethods.PERSON_ID, > Contacts.ContactMethods.DISPLAY_NAME, > Contacts.ContactMethods.KIND, > Contacts.ContactMethods.DATA, > Contacts.ContactMethods.TYPE > }; > > Cursor cursor = activity.managedQuery > (Contacts.ContactMethods.CONTENT_URI, returnColumns, null, null, > Contacts.ContactMethods.DISPLAY_NAME + " ASC"); > > In 2.0 AVD I always get 0 for cursor.getCount() - in 1.5/1.6 AVD this > works well. Of course I have created contacts in the AVD before. > If I click on "accounts" in the options menu of the Contacts > application if causes a "force close" (doesn't look pretty mature to > me). > The sad thing is that I have an application on the market and receive > complains about "force close" errors when contacts are accessed but > I'm unable to reproduce it with AVD.
You will need to use reflection (or intelligent class loading) and use the ContactsContracts provider when running on Android 2.0, allowing your existing Contacts code to be used on 1.5/1.6. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android Development Wiki: http://wiki.andmob.org -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en