简体   繁体   中英

Alter the “Complete action using” dialog

I am writing an app to send an MMS with an image file. I wrote the following code

Intent i = new Intent(Intent.ACTION_SEND);
        String sendfilepath = "file://" + sendfile.toString() + ".jpg";
        i.putExtra(Intent.EXTRA_STREAM,Uri.parse(sendfilepath)) ;
        i.setType("image/jpeg");
        startActivityForResult(i, 1) ;

However, the app shows The "Complete action using" dialog to choose from many things like Bluetooth, Email, facebook, Gmail, Handcent SMS, Messaging, play on Device.

I would like to show the dialog with only the things that are related to sending SMS or MMS like Messaging and Handcent SMS. I do not want to show all the other apps. How can I do that?

If you have a specific phone number that you are trying to let the user send a message to, use ACTION_SENDTO with a smsto: Uri for the phone number that you want to send the message to. That definitely works for SMS; I presume it will work for MMS, but I have not tried that.

Otherwise, what you want is not a good idea. Your users may wish to share their data via any number of mechanisms, some of which will not be MMS apps. Please let the users choose how to share their data .

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