简体   繁体   English

Android发送MMS程序吗?

[英]Android Send MMS programticaly?

I am trying to send mms grammatically this is my code 我正在尝试以语法方式发送彩信,这是我的代码

ntent sendIntent = new Intent(Intent.ACTION_SEND); 
            sendIntent.setClassName("com.android.mms", "com.android.mms.ui.ComposeMessageActivity");
            //sendIntent.setType("vnd.android-dir/mms-sms");
            sendIntent.putExtra("exit_on_sent", true);
            sendIntent.putExtra("address", sendingnumbeer);
            sendIntent.putExtra("sms_body", "Sample");   
            File dir = new File("/sdcard/VinstantMessage/");

            String path=dir.getAbsolutePath()+"/abc.mp4";
            File fl=new File(path);
            if(fl.exists()){
                System.out.println("file is exist");
            }
            Uri uri = Uri.fromFile(fl);
            sendIntent.putExtra(Intent.EXTRA_STREAM, uri);
            sendIntent.setType("video/*"); 
            sendIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
           // getApplicationContext().startActivity(sendIntent);
            startActivityForResult(sendIntent, 1);

it is opening the send mms window but i am unable to get user clicked on send mms or not ? 它正在打开发送彩信窗口,但我无法让用户点击发送彩信? how i can check this 我该如何检查

Thanks 谢谢

OK i have resolved the issue i was adding the "sendIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);" 确定,我已经解决了我添加“ sendIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)”的问题;

Remove this line and it will working good 删除此行,它将正常工作

thanks 谢谢

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

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