Peter Serwylo c8fa5303c4 Fixed issues with api version differences.
I moved the Utils.hasApi to the protected method in Compatibility.
It was misleading having it in Utils, because it is not as simple as
putting a "if(Utils.hasApi(11)) callApi_11_method()" there.

The problem isn't when the method is executed during runtime, it is when
the class is loaded into the VM using the classloader. At that point, it
tries to verify that indeed every method you call from your class
exists, so the conditional check doesn't work, hence VerifyError's and
breakage.

The appropriate way to do it is the same way as the Android support
library does it. The goal is to have an interface which only one
implementation is every loaded at runtime. Any implementations for
versions that your device doesn't support will never get loaded, so no
VerifyErrors. If you have the support library installed in your
Android SDK, check out
extras/android/support/v4/src/java/android/support/v4/view/MenuItemCompat.java
to see how the pattern works.
2013-07-21 08:14:57 +10:00
2013-07-08 17:27:49 +01:00
2012-08-25 09:54:35 +01:00
2013-07-21 07:20:53 +10:00
2013-06-30 22:34:42 +02:00
2010-10-19 23:24:04 +01:00
2012-08-17 16:49:15 +01:00
2012-08-17 16:48:00 +01:00
2013-04-12 14:45:48 +01:00
2011-01-20 23:34:29 +00:00
Description
No description provided
GPL-3.0 46 MiB
Languages
Java 98.5%
Shell 0.6%
Python 0.6%
AIDL 0.2%
HTML 0.1%