How to send email via Glass

a 夏天 提交于 2019-12-07 03:05:43

问题


I am trying to send an image taken from Glass with below code...

Intent emailIntent = new Intent( android.content.Intent.ACTION_SEND);
emailIntent.setType("plain/text");
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[] {     
    "xyz@gmail.com" });
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "My Subject");
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "My image attached");
emailIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(imageLocation));
startActivity(Intent.createChooser(emailIntent, "Send mail..."));

But I am getting "No apps can perform this action". I believe that there is no such intent in Glass. Can anyone provide the alternate solution, so that I can send email through Glass.


回答1:


Without an email intent on Glass you will have to do it in a more raw way, there are instructions in this answer for doing so, including emails with an attached image, note the part about internet permission:

Sending Email in Android using JavaMail API without using the default/built-in app



来源:https://stackoverflow.com/questions/23358617/how-to-send-email-via-glass

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!