アプリにテキストボックス(EditText)とボタンがあります。ボタンをタップすると、テキストボックス(EditText)に書き込まれたテキストがコピーされ、このテキストを任意のアプリで共有できるようになります。 as-メッセージング、Gmail、Ymailなど。今私がしているのは、「EditText」からテキストを取得し、「a」と言う新しい変数(文字列)に保存して、インテント「ACTION_SEND_MULTIPLE」を適用することです。
これがインテントのコードです
Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND_MULTIPLE);
emailIntent.setType("text/plain");
emailIntent.putExtra(Intent.EXTRA_EMAIL, new String[] {"example@gmail.com"});
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "a");
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, a);
startActivity(Intent.createChooser(emailIntent, "Share it via..."));