Code example for ClipboardManager

Methods: setPrimaryClip

    private void copy(CharSequence text) {
        ClipboardManager clipboard =
                (ClipboardManager) mActivity.getSystemService(Context.CLIPBOARD_SERVICE);
        clipboard.setPrimaryClip(ClipData.newPlainText(null, text));
    public void onCreateContextMenu(ContextMenu menu, View v,
            ContextMenuInfo info) {
        // FIXME: This is copied over almost directly from BrowserActivity. 
        // Would like to find a way to combine the two (Bug 1251210). 
        WebView webview = (WebView) v;
        WebView.HitTestResult result = webview.getHitTestResult();
        if (result == null) {
        int type = result.getType();
Connect your IDE to all the code out there  Get Codota for Java