1、ClipboardManager clipboardManager = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
2、拷贝数据的做法:需要把你所要拷贝的内容作为String 赋给baseToString 即可。下面是copy文本数据:
ClipData cd = ClipData.newPlainText("label", baseToString);
clipboardManager.setPrimaryClip(cd);
拷贝URI数据:
Uri copyUri = Uri.parse(CONTACTS + COPY_PATH + "/" + "XiaoMa");
ClipData clipUri = ClipData.newUri(getContentResolver(),"URI",copyUri);
clipboard.setPrimaryClip(clipUri)
拷贝intent数据:
Intent appIntent = new Intent();
Bundle bundle = new Bundle();