简体   繁体   中英

Android how to send mms?

I am trying to send mms from android application Using

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

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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