这是监听器:
class ClipboardListener implements ClipboardManager.OnPrimaryClipChangedListener{ public void onPrimaryClipChanged() { // do something useful here with the clipboard // use getText() method }}
只需注册:
ClipboardManager clipBoard = (ClipboardManager)getSystemService(CLIPBOARD_SERVICE);clipBoard.addPrimaryClipChangedListener( new ClipboardListener() );
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)