在android studio 开发中实现将文字复制到粘贴板的功能:
public static void copyToClipboard(Context context, String text) { ClipboardManager systemService = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE); systemService.setPrimaryClip(ClipData.newPlainText("text", text)); }
上述代码有参考其他人博客,仅供参考。