Java 从剪贴板共享文本
我向所有善良的人寻求一点帮助 我从textview复制文本的代码是:Java 从剪贴板共享文本,java,android,Java,Android,我向所有善良的人寻求一点帮助 我从textview复制文本的代码是: ClipboardManager clipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE); clipboard.setText(returnedText.getText()); 共享复制文本的我的代码: Intent sharingIntent = new Intent(and
ClipboardManager clipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
clipboard.setText(returnedText.getText());
共享复制文本的我的代码:
Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
sharingIntent.setType("text/plain");
String shareBody = "Should be copied text from Clipboard here";
String shareSub = "My subject";
sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, shareSub);
sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareBody);
startActivity(Intent.createChooser(sharingIntent, "Share using"));
我有一个问题,我应该怎么做才能自动发送到共享体中,从剪贴板复制文本???这意味着,如果我理解正确,整个文本已经保存在邮件正文中,而不是从剪贴板复制文本。是否要将textview中的文本指定给shareBody变量? 那样的话你可以
String shareBody = returnedText.getText().toString();