title: Android clipboard code that works on all API levels
body: <p>The clipboard code that works for API levels &lt; 11 crashes on devices with API levels >= 11.</p>
  
  <p>The clipboard code that work for API level >= 11 crashes on devices with API levels &lt; 11.</p>
  
  <p>I can not compile code for both versions because they have conflicting import requirements.</p>
  
  <p>One needs:
  import  android.text.ClipboardManager;</p>
  
  <p>while the other needs:
  import android.content.ClipboardManager;</p>
  
  <p>Surely there is a way write some code that will work on both sides of API level 11. I just can't figure it out.</p>
  
  <p><em><strong></em>**<em>*</em></strong><em>Edited (Since I can't answer my own question) <strong></em>**<em>*</em>**<em>*</em>*</strong></p>
  
  <p>I found the problem. The exception message says, "Can't create handler inside a thread that has not called Looper.prepare()."</p>
  
  <p>Apparently I have to jump through some more hoops since I am executing this code from an Async task.</p>