Re: [android-developers] How to code ContactsContract so that it runs in 2.2 and doesn't crash 1.5?

2010-07-28 Thread Donal Rafferty
Thanks Kostya, I have grasped that now and have it working in one part of my application. I have another problem now though. I have this in code: Uri contactUri = ContentUris.withAppendedId (Contacts.People.CONTENT_URI, contactId); Intent intent = new Intent(Intent.ACTION_VIEW, contactUri);

Re: [android-developers] How to code ContactsContract so that it runs in 2.2 and doesn't crash 1.5?

2010-07-28 Thread Donal Rafferty
Actually I have found the solution to the above problem, well kind of, it turns out the problem is elsewhere, I am trying to find the Id of a contact via the phone number and try as follows but I get an ID of 2324 when it should be 404, anyone any ideas why? static { int sdk=new

[android-developers] How to code ContactsContract so that it runs in 2.2 and doesn't crash 1.5?

2010-07-27 Thread draf...@gmail.com
I have the following piece of code in my Android application that looks up a contacts ID, I have just changed the target from 1.5 to 2.2 but with a min SDK of 3 (1.5) so that I can use the ContactsContract Uri in 2.2 and the People Uri in 1.5. However the code leads to the following error when

Re: [android-developers] How to code ContactsContract so that it runs in 2.2 and doesn't crash 1.5?

2010-07-27 Thread Kostya Vasilyev
Hi, The offending line is this: ContactsContract.Contacts Even though you're not referencing this nested member on the execution path, the Java VM still tries to resolve all external references made by your code. This is done when your code is first loaded into memory for execution, before