Tag: 剪贴板交互

如何在Android中将文本复制到剪贴板?

任何人都可以请告诉我如何按下button时,将特定文本视图中的文本复制到剪贴板? 谢谢:) @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.mainpage); textView = (TextView) findViewById(R.id.textview); copyText = (Button) findViewById(R.id.bCopy); copyText.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub ClipboardManager clipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE); String getstring = textView.getText().toString(); //Help to continue 🙂 } }); } } 当按下bCopybutton时,我想将TextView textView中的文本复制到剪贴板! 请帮忙…