2012-12-06 48 views

回答

0

試試這個音頻:

private File file; 
file = new File("audio file name/ path"); 
    File filelocation = file ; 
    Intent sharingIntent = new Intent(Intent.ACTION_SEND); 
    sharingIntent.setType("audio/mp4"); 
    sharingIntent.putExtra(Intent.EXTRA_EMAIL, "[email protected]"); 
    sharingIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://"+filelocation.getAbsolutePath())); 
    startActivity(Intent.createChooser(sharingIntent, "Send email")); 

嘗試一下本作的圖像:

private File file; 
    file = new File("your image path"); 
    File filelocation = file ; 
    Intent sharingIntent = new Intent(Intent.ACTION_SEND); 
    sharingIntent.setType("image/jpeg"); 
    sharingIntent.putExtra(Intent.EXTRA_EMAIL, "[email protected]"); 
    sharingIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://"+filelocation.getAbsolutePath())); 
    startActivity(Intent.createChooser(sharingIntent, "Send email")); 
+0

但如何既從圖像繪製和音頻文件以電子郵件附? – Biginner

+0

你必須添加圖像和音頻文件在同一封郵件中可繪製? –

+0

如何將音頻文件從資產文件夾附加到電子郵件? – Biginner

相關問題