2009-06-29 10 views
3

添付されたjpgを使用して電子メールの意図を開始しようとしています。添付された画像で電子メールインテントを起動するにはどうすればよいですか?

私がやった:

Intent intent4 = new Intent(Intent.ACTION_SENDTO, 
Uri.fromParts("mailto", "[email protected]", null)); 
startActivity(intent4); 

これは、電子メール活動を起動します。

しかし、私はDataAndType(私のjpeg添付)を追加しようとします。あなたが"image/jpeg"代わりのBitmap.CompressFormat.JPEG.name()に手動でMIMEを設定してみましたそれは

android.content.ActivityNotFoundException: No Activity found to handle Intent { action=android.intent.action.SENDTO data=file:///data/data/com.mycompany.mypackage/files/temp-picture type=JPEG 


Intent intent4 = new Intent(Intent.ACTION_SENDTO, 
    Uri.fromParts("mailto", "[email protected]", null)); 
intent4.setDataAndType(Uri.parse("file://"+ mTempFilePath), 
    Bitmap.CompressFormat.JPEG.name());  
startActivity(intent4); 

答えて

関連する問題