0

描画可能なフォルダーに画像があり、その画像をグリッドビューで取得しています。また、選択したフルスクリーンで特定の画像を表示しています。今、画像を添付して MMS を送信したいと考えています。

画像を表示するコードは次のとおりです。そして、MMS を送信します。Uri をインテントに入れる方法または画像の添付ファイルを送信する方法。

imageView.setImageResource(imageAdapter.mThumbIds[position]);



Intent sendIntent = new Intent(Intent.ACTION_SEND);
             sendIntent.putExtra("sms_body", "Hii");
             sendIntent.setType("image/png");

             startActivity(sendIntent);
4

1 に答える 1

0

mms を送信するには、次のコードを使用します。

 Intent intent = new Intent(Intent.ACTION_SEND);
    intent.putExtra("sms_body", "Hi how are you");
    intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File("/sdcard/file.gif")));
    intent.setType("image/gif"); 
    startActivity(Intent.createChooser(intent,"Send"));



Uri uri = Uri.parse("android.resource://your.package.here/drawable/image_name");

編集:

Intent intent = new Intent(Intent.ACTION_SEND);
        intent.putExtra("sms_body", "Hi how are you");
        Uri uri = Uri.parse("android.resource:// com.example.stack/drawable/ic_launcher.png");
        intent.putExtra(Intent.EXTRA_STREAM,uri );
        intent.setType("image/png"); 
        startActivity(Intent.createChooser(intent,"Send"));
于 2013-03-05T10:49:12.343 に答える