Code example for ClipboardManager

Methods: removePrimaryClipChangedListener

0
    } 
 
    @Override 
    protected void onDestroy() { 
        super.onDestroy(); 
        mClipboard.removePrimaryClipChangedListener(mPrimaryChangeListener);
    } 
 
    public void pasteStyledText(View button) {
        mClipboard.setPrimaryClip(ClipData.newPlainText("Styled Text", mStyledText));
    } 
 
    public void pastePlainText(View button) {
        mClipboard.setPrimaryClip(ClipData.newPlainText("Styled Text", mPlainText));
    } 
 
    public void pasteIntent(View button) {
        Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.android.com/"));
        mClipboard.setPrimaryClip(ClipData.newIntent("VIEW intent", intent));
    }