clean Up Clipboard - Android Android OS

Android examples for Android OS:Clipboard

Description

clean Up Clipboard

Demo Code


//package com.java2s;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;

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

Related Tutorials