当我尝试通过意图将 EditText 中的文本字符串传递到 Facebook 或 Twitter 时遇到问题。事实上,目前唯一可行的选择是电子邮件。我正在使用的代码如下:
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_TEXT, textVariable.getText());
intent.putExtra(Intent.EXTRA_SUBJECT, "Subject Title");
startActivity(Intent.createChooser(intent, "Share Text"));
我已经尝试过使用和不使用主题行。有什么想法吗?
谢谢 :)