The clipboard code that works for API levels < 11 crashes on devices with API levels >= 11.
The clipboard code that work for API level >= 11 crashes on devices wi
The clipboard code that works for API levels < 11 crashes on devices with API levels >= 11.
This sample project works quite nicely on API levels before and after 11. I just retested it on Android 2.3 (Nexus One) and Android 4.0 (Nexus S).
The clipboard code that work for API level >= 11 crashes on devices with API levels < 11.
That is not surprising. If you are referring to classes or methods that do not exist in older versions of Android, you will get a VerifyError
or similar crashes.
I can not compile code for both versions because they have conflicting import requirements.
Not really.
One needs: import android.text.ClipboardManager;
That works on all API levels.
while the other needs: import android.content.ClipboardManager;
That was added to API Level 11. If your app will only run on API Level 11 or higher, use this class (method signatures are all the same IIRC).