发送带有图片的彩信 [英] To send MMS with Image

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

问题描述

我将图像保存在drawable文件夹中,并在gridview中获取了图像.我还在全屏显示选择的垂直图像.现在我要发送带有图像附件的MMS.

I have my images in drawable folder and I am getting that images in gridview.Also I am showing the perticular image on selection fullscreen.Now I want to send MMS with image attachment.

这是我的代码以显示图像.并发送MMS.如何让Uri投入使用或如何发送图片附件.

Here is my code to show the image. And to send MMS.how to get Uri to put to intent or how to send the image attachment.

imageView.setImageResource(imageAdapter.mThumbIds[position]);



Intent sendIntent = new Intent(Intent.ACTION_SEND);
             sendIntent.putExtra("sms_body", "Hii");
             sendIntent.setType("image/png");

             startActivity(sendIntent);

推荐答案

使用以下代码发送mms.

Use the following code to send the mms.. Hope this wil help you.

 Intent intent = new Intent(Intent.ACTION_SEND);
    intent.putExtra("sms_body", "Hi how are you");
    intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File("/sdcard/file.gif")));
    intent.setType("image/gif"); 
    startActivity(Intent.createChooser(intent,"Send"));



Uri uri = Uri.parse("android.resource://your.package.here/drawable/image_name");

Intent intent = new Intent(Intent.ACTION_SEND);
        intent.putExtra("sms_body", "Hi how are you");
        Uri uri = Uri.parse("android.resource:// com.example.stack/drawable/ic_launcher.png");
        intent.putExtra(Intent.EXTRA_STREAM,uri );
        intent.setType("image/png"); 
        startActivity(Intent.createChooser(intent,"Send"));

这篇关于发送带有图片的彩信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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