You're getting this error because ClipboardManager
was introduced in API level 11, while you're running the app on API level 10.
When you're using code that was introduced in API levels greater than your declared minSDK
version make sure you're checking on what platform you're actually running. Guard the API that the running device cannot support, as per below sample code:
public void myMagicCode() {
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
methodThatUsesClipboardManager();
}
}
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
protected void methodThatUsesClipboardManager() {
ClipboardManager instance = (ClipboardManager)getSystemService(Context.CLIPBOARD_SERVICE);
//use the instance
}