我尝试在电子邮件正文中添加换行符,但“\n”或 System.getProperty("line.separator") 都不起作用,我该怎么办?谢谢!
Intent emailIntent=new Intent(Intent.ACTION_SEND);
String subject = "Your sms sent by email";
String body = "aa"+"\n"+"bb"+System.getProperty("line.separator")+"cc" ;
String[] extra = new String[]{"aa@gmail.com"};
emailIntent.putExtra(Intent.EXTRA_EMAIL, extra);
emailIntent.putExtra(Intent.EXTRA_SUBJECT, subject);
emailIntent.putExtra(Intent.EXTRA_TEXT, body);
emailIntent.setType("message/rfc822");
startActivity(emailIntent);