A more straightforward approach that should work is to isolate the affected code behind an interface, with separate implementations for 1.1 and 1.5. A factory method can be used to opaquely return the correct instance based on the build's sdk version. This has the advantage that you can usually hold onto a reference to the appropriate implementation and avoid repeatedly checking the version number. It does add the cost of a interface method call, but that's perfectly acceptable in most instances - if not, it's usually because the work is being done in an inner loop, in that case you generally need to replicate the loop for both implementations.
Tom. 2009/4/15 Pieter <[email protected]> > > If the amount of "1.5" code is small, you can use reflection to make > the calls in order to fool the verifier. This quickly becomes a pain > in the butt when you have to call more than a few 1.5 methods or work > with multiple 1.5 objects though. > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

