3

Im using the following code to send audio-files through email, dropbox +++.. This is not giving me the option to send the same file through MMS.. Anyone know how to attach it to a MMS and let the user send if he/she wants?

        Intent share = new Intent(Intent.ACTION_SEND);
        share.setType("audio/3gpp");
        share.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://" + aFile));
        startActivity(Intent.createChooser(share, "Send file"));
user484146
  • 301
  • 1
  • 7
  • 14

1 Answers1

0

you can used this code..

Intent sendIntent = new Intent(Intent.ACTION_SEND); 
            sendIntent.setClassName("com.android.mms", "com.android.mms.ui.ComposeMessageActivity");
            sendIntent.putExtra("address", "9999999999");
            sendIntent.putExtra("sms_body", "if you are sending text");   
            final File file1 = new File(Environment.getExternalStorageDirectory().getAbsolutePath(),"Downloadtest.3gp");
            Uri uri = Uri.fromFile(file1);

            sendIntent.putExtra(Intent.EXTRA_STREAM, uri);
            sendIntent.setType("video/3gp");
            startActivity(Intent.createChooser(sendIntent, "Send file"));

you have to used your appropriate set type .if audio then audio/*,image then image/png

This code work my samsung nexus,ace 5830 but not working htc amaze.If any one found any solution then please give snippet.

Harshid
  • 5,701
  • 4
  • 37
  • 50