Sunday, March 25, 2012

Re: [android-developers] Launching default messaging app for mms

On Sun, Mar 25, 2012 at 7:21 PM, Farhan Tariq <farhan.blu@gmail.com> wrote:
> Intent picMessageIntent = new Intent(android.content.Intent.ACTION_SEND);
> picMessageIntent.putExtra("address", "Some Numbers");
> picMessageIntent.setType("image/jpeg");
> picMessageIntent.putExtra("sms_body", "Some Text");
> picMessageIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(file));
>
>
> Yes, I understand now that the package may not be there in a device, so it
> is giving a chooser.
>
> Is there a way to find the default messaging application or the built-in
> messaging, and set its package in the intent above?

If there is a default, it is because the user chose it to be the
default, and no chooser dialog will appear -- the user will be taken
straight to that default. If there is only one messaging app, no
chooser dialog will appear -- the user will be taken straight to that
app. If there is no default and there is more than one app, PLEASE
ALLOW THE USER TO CHOOSE WHICH SMS CLIENT THEY WANT TO USE.

Hence, please delete:

picMessageIntent.setPackage("com.android.mms");

so your app does what the USER wants and will work on more devices.

--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to *Advanced* Android Development_ Version 2.5
Available!

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate