Hi:
I am working on an Android application that is supposed to run on Android 1.5 and later devices. I am using RawContacts.CONTENT_URI
enumeration for registering a ContentObserver
in my application subclass. Now, RawContacts was introduced in Eclair and running this code on Android devices having runtime less than 2.0, gives java.lang.VerifyError. For older devices, I have to use Contacts.CONTENT_URI
.
So to fix this, I've put something like the following in my code:
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.ECLAIR){
uri = android.provider.ContactsContract.RawContacts.CONTENT_URI;
}
else{
uri = android.provider.Contacts.CONTENT_URI;
}
I am still getting java.lang.VerifiyErrors.
How do I setup my code for different runtimes?