Android 将图像作为附件从资源发送
这是我的代码,它确实发送邮件,但没有任何图像作为附件Android 将图像作为附件从资源发送,android,email-attachments,android-assets,Android,Email Attachments,Android Assets,这是我的代码,它确实发送邮件,但没有任何图像作为附件 EditText eto=(EditText)findViewById(R.id.etxtTo); EditText esub=(EditText)findViewById(R.id.etxtSubject); String to=eto.getText().toString(); String sub=esub.getText().toString(); Intent emailIntent = new Intent(andr
EditText eto=(EditText)findViewById(R.id.etxtTo);
EditText esub=(EditText)findViewById(R.id.etxtSubject);
String to=eto.getText().toString();
String sub=esub.getText().toString();
Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.setType("application/image");
//emailIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
//String filePath = ImageDetailActivity.this.getResources().getAssets()+"/"+file;
//Log.d("file address",filePath);
//Log.d("file address method2","file:///android_assets/"+file);
File ff=new File(filePath);
pngUri=Uri.fromFile(new File("file:///android_assets/"+file));
emailIntent.putExtra(Intent.EXTRA_EMAIL, new String[]{to});
emailIntent.putExtra(Intent.EXTRA_SUBJECT, sub);
emailIntent.putExtra(android.content.Intent.EXTRA_STREAM,Uri.parse("file:///android_assets/"+file));
startActivity(Intent.createChooser(emailIntent, "Choose an Email client :"));
这里的问题是我无法接收邮件附带的图像。
我尝试了很多方法来寻找解决方案,但无法解决问题,你的问题是?我收到了邮件,但没有图片作为附件。谢谢你收到的是没有附件的邮件还是有“空”附件的邮件?我收到的是没有附件的邮件。