I have a problem with copying a text to the clipboard. I try to copy like this:
android.content.ClipboardManager clipboard = ( android.content.ClipboardManager ) getSystemService(Context.CLIPBOARD_SERVICE );
android.content.ClipData clip = android.content.ClipData.newPlainText( "text label", "text to clip" );
clipboard.setPrimaryClip( clip );
But problem is in the compiler which throws:
Call requires API level 11 (current min is 7): android.content.ClipboardManager#setPrimaryClip line 245 Android Lint Problem.
How I can copy a text to the clipboard on android API < 11? If i try to check API version of android before copying - my code even doesn't compile. Maybe someone knows an answer to this question?