の Sending Content to Other Apps を見ていきます。
アプリ間でのコンテンツの共有ですが、
うーん、正直前回までやってた Interacting with Other Apps
と何が違うの?って感じです。

テーマも似たようなものですし
まあ、とりあえず見てきます。
テキストを送る場合
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, "This is my text to send.");
sendIntent.setType("text/plain");
startActivity(Intent.createChooser(sendIntent,getResources().getText(R.string.send_to)));
うーん前やった事と同じ・・・
バイナリデータの場合
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.putExtra(Intent.EXTRA_STREAM, uriToImage);
shareIntent.setType("image/jpeg");
startActivity(Intent.createChooser(shareIntent, getResources().getText(R.string.send_to)));
この場合、受信する側のアプリがファイルにアクセスできるようにするため
ファイルは外部ストレージにある必要があります。
複数ファイルの場合
ArrayList<Uri> imageUris = new ArrayList<Uri>();
imageUris.add(imageUri1);
imageUris.add(imageUri2);
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND_MULTIPLE);
shareIntent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, imageUris);
shareIntent.setType("image/*");
startActivity(Intent.createChooser(shareIntent, "Share images to.."));
少し違いがあるだけでやってる事は一緒ですね。
やった事のあることでしたのでほとんど説明は省きます。
今日はここまでー。