clean Up Clipboard - Android android.content

Android examples for android.content:Clipboard

Description

clean Up Clipboard

Demo Code

import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.view.ActionMode;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.EditText;

public class Main{

    public static void cleanUpClipboard(Context context) {
        ClipboardManager cbm = (ClipboardManager) context
                .getSystemService(Context.CLIPBOARD_SERVICE);
        ClipData data = ClipData.newPlainText("", "");
        cbm.setPrimaryClip(data);/*from  w  w  w  .j  a va 2 s.  com*/
    }

}

Related Tutorials