It is always best to look into the source code of the MMS app. The Manifest defines *either* SENDTO + mms-URI *or* SEND + media URI: http://android.git.kernel.org/?p=platform/packages/apps/Mms.git;a=blob;f=AndroidManifest.xml;h=dd380e50427e78dbdee22176d8927786e924e24c;hb=HEAD#l77
There is no intent filter to receive SENDTO + media URI, or SEND + mms- URI, so the combinations you tried above won't work. Luckily, looking into the source code, there seems to be a back door: http://android.git.kernel.org/?p=platform/packages/apps/Mms.git;a=blob;f=src/com/android/mms/ui/ComposeMessageActivity.java;h=757c8decf52614033006a929e19a956bc941e095;hb=HEAD#l3231 You can put a String extra "address" to specify the address. I have not tried it, but from the source this seems to be the case. I should point out that it seems unfortunate that the MMS team did not consider using one of the documented extras, like for example EXTRA_PHONE_NUMBER http://developer.android.com/reference/android/content/Intent.html#EXTRA_PHONE_NUMBER Peli www.openintents.org On Jul 17, 6:27 am, n179911 <[email protected]> wrote: > Thank you. > > I am trying to resolve/work around a problem which I am having when > launching MMS Activity. > I would like to launch MMS Compose Message Activity with "To:" field > filled and an image attached. > > This works (send to a specified phone #): > intent = new Intent(Intent.ACTION_SENDTO, Uri.parse("smsto:1234567")); > This works (attached an image): > intent = new Intent(Intent.ACTION_SEND); > intent.setType(mMimeType); > intent.putExtra("address", item.mValue); > intent.putExtra(Intent.EXTRA_STREAM, mUri); > > But when i combine the 2 together, android can't find an activity for it. > intent = new Intent(Intent.ACTION_SENDTO, Uri.parse("smsto:1234567")); > intent.setType("image/jpeg"); > intent.putExtra(Intent.EXTRA_STREAM, mUri); > > even if i put ClassName in the intent: > intent = new Intent(Intent.ACTION_SENDTO, Uri.parse("smsto:1234567")); > intent.setType("image/jpeg"); > intent.setClassName("com.android.mms", > "com.android.mms.ui.ComposeMessageActivity"); > intent.putExtra(Intent.EXTRA_STREAM, mUri); > > I really appreciate if you can help me with this. > > Thank you. > > On Thu, Jul 16, 2009 at 7:41 PM, Dianne Hackborn<[email protected]> wrote: > > That is not what it is for; it is to specify an Intent that is directly > > targeted to one of your own components. > > > On Thu, Jul 16, 2009 at 7:32 PM, n179911 <[email protected]> wrote: > > >> Hi, > > >> I would like to know how to use the setComponent() of Intent. > >> I read the javadoc. But how can I specify the Text Messaging > >> Application when callings setComponent()? > > >> * @param component The name of the application component to handle the > >> * intent, or null to let the system find one for you. > > >> Thank you. > > > -- > > Dianne Hackborn > > Android framework engineer > > [email protected] > > > Note: please don't send private questions to me, as I don't have time to > > provide private support, and so won't reply to such e-mails. All such > > questions should be posted on public forums, where I and others can see and > > answer them. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

