title: Android: Copying a text to the clipboard for API < 11
body: <p>I have a problem with copying a text to the clipboard. I try to copy like this:</p>
  
  <pre><code>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 );
  </code></pre>
  
  <p>But problem is in the compiler which throws:</p>
  
  <pre><code>Call requires API level 11 (current min is 7): android.content.ClipboardManager#setPrimaryClip line 245 Android Lint Problem.
  </code></pre>
  
  <p>How I can copy a text to the clipboard on android API &lt; 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?</p>