Steve
2010-01-13 10:21:14 UTC
Hi. What is the recommended way to launch the messaging app (for
sending an MMS message) via an intent? The following code works on my
HTC Magic ...
Intent intent = new Intent(Intent.ACTION_SEND);
intent.putExtra("address", "0215555555");
intent.putExtra("sms_body", "my message text");
intent.putExtra(Intent.EXTRA_STREAM, imageUri); // imageUri set
previously
intent.setType("image/jpeg");
startActivity(intent);
... but it first launches the Resolver activity
(com.android.internal.app.ResolverActivity), prompting the user to
select the appropriate app (Email, Gmail, Messaging, Picasa). The
user has to select Messaging before proceeding.
The only way I've found to bypass the resolver is to explicity set the
desired component on the intent before starting the activity as
follows:
intent.setClassName("com.android.mms",
"com.android.mms.ui.ComposeMessageActivity");
However, I'm guessing this approach will not work on devices that have
a customised UI, like the HTC Hero. Can someone confirm/deny?
I'm also struggling to find official documentation for the "address"
and "sms_body" fields that can be supplied as extra data as per the
above example. Is it expected that these will be supported by the
default messaging app in future SDK versions and in customised UIs
(like HTC's Sense UI)?
Thanks in advance ...
sending an MMS message) via an intent? The following code works on my
HTC Magic ...
Intent intent = new Intent(Intent.ACTION_SEND);
intent.putExtra("address", "0215555555");
intent.putExtra("sms_body", "my message text");
intent.putExtra(Intent.EXTRA_STREAM, imageUri); // imageUri set
previously
intent.setType("image/jpeg");
startActivity(intent);
... but it first launches the Resolver activity
(com.android.internal.app.ResolverActivity), prompting the user to
select the appropriate app (Email, Gmail, Messaging, Picasa). The
user has to select Messaging before proceeding.
The only way I've found to bypass the resolver is to explicity set the
desired component on the intent before starting the activity as
follows:
intent.setClassName("com.android.mms",
"com.android.mms.ui.ComposeMessageActivity");
However, I'm guessing this approach will not work on devices that have
a customised UI, like the HTC Hero. Can someone confirm/deny?
I'm also struggling to find official documentation for the "address"
and "sms_body" fields that can be supplied as extra data as per the
above example. Is it expected that these will be supported by the
default messaging app in future SDK versions and in customised UIs
(like HTC's Sense UI)?
Thanks in advance ...