问题描述
|
当我将csv文件附加到android上的默认电子邮件应用程序时,以下代码有效,但是当我将同一文件附加到gmail应用程序时,以下代码不起作用。有没有人可以解决Gmail问题?
Resources res = getResources();
FileOutputStream outPut;
try {
outPut = getApplicationContext().openFileOutput(\"IPAddressplanner.csv\",Context.MODE_WORLD_READABLE);
SendMail.createCSVAttachment(outPut,res,values_subnet,values_mask,values_inverse,values_subnet_size,values_host_range,values_broadcast);
File F = getApplicationContext().getFileStreamPath(\"IPAddressplanner.csv\");
Uri U = Uri.fromFile(F);
Intent i = new Intent(Intent.ACTION_SEND);
i.setType(\"message/rfc822\"); // use from live device
i.putExtra(Intent.EXTRA_SUBJECT,\"IPV4 Address information\");
i.putExtra(Intent.EXTRA_STREAM,U);
startActivity(Intent.createChooser(i,\"Select email application.\"));
} catch (FileNotFoundException e) {
Log.e(TAG,e.getMessage());
}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)