itpepe
// 3.O以后和3.0以前,复制到剪贴板的方法不一致
        if (DevUtil.hasHoneycomb()) {
            ClipboardManager copy = (ClipboardManager) mContext.getSystemService(Context.CLIPBOARD_SERVICE);
            copy.setPrimaryClip(ClipData.newPlainText("url", content));
        } else {
            android.text.ClipboardManager copy = (android.text.ClipboardManager) mContext
                    .getSystemService(Context.CLIPBOARD_SERVICE);
            copy.setText(content);
        }

        showToast(mContext.getString(R.string.pub_share_platform_copy_url_success));

 

分类:

技术点:

相关文章:

  • 2021-12-03
  • 2021-12-19
  • 2022-12-23
  • 2022-01-03
  • 2022-12-23
  • 2021-12-03
  • 2021-04-18
猜你喜欢
  • 2022-12-23
  • 2021-12-19
  • 2021-12-19
  • 2021-12-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案