Code example for SynchronousQueue

Methods: take

0
                    sClipboardQueue.put(text != null ? text : "");
                } catch (InterruptedException ie) {}
            } 
        }); 
        try { 
            return sClipboardQueue.take();
        } catch (InterruptedException ie) {
            return ""; 
        } 
    } 
 
    @GeneratableAndroidBridgeTarget(stubName = "SetClipboardText") 
    public static void setText(final CharSequence text) {
        ThreadUtils.postToBackgroundThread(new Runnable() {
            @Override 
            @SuppressWarnings("deprecation") 
            public void run() { 
                if (Build.VERSION.SDK_INT >= 11) {
                    android.content.ClipboardManager cm = getClipboardManager11(mContext);
                    ClipData clip = ClipData.newPlainText("Text", text);