简体   繁体   English

Android如何发送彩信?

[英]Android how to send mms?

I am trying to send mms from android application Using我正在尝试从 android 应用程序使用发送彩信

Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra("sms_body", "Sent using Spootur");
sendIntent.setType("image/png");
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File(imagePath)));
startActivityForResult(sendIntent, SEND_ACTIVITY);

But it is open a android default sharing popup but i want to launch mms window directly how i can do that但它打开了一个 android 默认共享弹出窗口,但我想直接启动 mms 窗口,我该怎么做

Thnaks纳克斯

try this one试试这个

Uri uri = Uri.parse("file://"+Environment.getExternalStorageDirectory()+"/test.png");
Intent i = new Intent(Intent.ACTION_SEND);
i.putExtra("address","to address");
i.putExtra("sms_body","ent using Spootur");
i.putExtra(Intent.EXTRA_STREAM,"file:/"+uri);
i.setType("image/png");
startActivity(i);

have to make changes in AndroidManifest必须在 AndroidManifest 中进行更改

<uses-permission android:name="android.permission.RECEIVE_MMS" />
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM