作为电子邮件附件发送图片 [英] Images as Email Attachment

查看:115
本文介绍了作为电子邮件附件发送图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要建立我在哪里可以附加图像的电子邮件,打开图像,并将其设置为我的墙纸应用程序。我想让它跨平台,你能告诉我,如果它的使用PhoneGap的可能还是我必须搭建iPhone和Android原生应用?

I want to build an application where i am able to attach an image with the email, open the image and set it as my wallpaper. I wanted to make it cross platform so can you tell me if its possible using phonegap or do i have to build a native application for iphone and android?

推荐答案

您好,如果您只想附加图像的电子邮件,然后用这个code,你可以做到这一点。

Hello if you want to just attach your image with email then using this code you can do this..

ArrayList<String> str = new ArrayList<String>() ;
ArrayList<Uri> uris = new ArrayList<Uri>();

//convert from paths to Android friendly Parcelable Uri's
for(int i=0; i<ayy_Images.size(); i++)
{
   if(ayy_Images.get(i) == null)
    {
       str.add("");
    }
    else
    {
       str.add(ayy_Images.get(i));
    }
}

for (String file : str)
{
   File fileIn = new File(file);
   Uri u = Uri.fromFile(fileIn);
   uris.add(u);
}

startActivity(Intent.createChooser(new Intent(Intent.ACTION_SEND_MULTIPLE).setType("audio/wav").setType("image/jpeg").setType("message/rfc822")
                            .putExtra(Intent.EXTRA_EMAIL, emails)
                            .putExtra(Intent.EXTRA_SUBJECT, subject)
                            .putExtra(Intent.EXTRA_TEXT, strDetails).putExtra( android.content.Intent.EXTRA_STREAM, uris), "Send your email in:"));             

ayy_Images 是一个ArrayList中包含的图像列表。

ayy_Images is a ArrayList which contains the list of images.

这篇关于作为电子邮件附件发送图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆