Reputation: 1252
Intent intent = new Intent(Intent.ACTION_SENDTO);
intent.putExtra("address", "12134567899");
intent.putExtra("sms_body", "See attached picture");
intent.putExtra(Intent.EXTRA_STREAM,
Uri.parse("file:///sdcard/DCIM/Camera/2011-09-09 12.47.29.jpg"));
intent.setType("image/png");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
i try code like this. if intent start mms compose ui was coming how can i overcome and send automatically
Upvotes: 1
Views: 3376
Reputation: 643
try this its worked with me . use Uri.fromFile instead of Uri.parse
File f=new File(Environment.getExternalStorageDirectory().getAbsolutePath()+"/DCIM/Camera/"+img_name);
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra("", "");
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(f));
sendIntent.setType("image/png");
startActivity(sendIntent);
Upvotes: 0
Reputation: 1542
This feature was designed as a safety feature in Android, please do not try to bypass it. It's there for a reason.
If you absolutly must, have you tried running it on a rooted device? It allows greater access.
Upvotes: 1
Reputation: 2348
First of all. good luck. Since MMS isn't supported by the android sdk, you have 2 options:
download the android mms aplication and try to understand what's going on there.
follow this link: http://androidbridge.blogspot.com/2011/03/how-to-send-mms-programmatically-in.html
only thing I found working at the moment....
Upvotes: 4