Hi,

You could try this:

Intent m_intent = new Intent(Intent.ACTION_VIEW, Uri.parse(sms:
0600000000));
m_intent.putExtra("sms_body", "Hello World");
startActivity(m_intent);

On Dec 16, 10:50 pm, Bibou <mebi...@gmail.com> wrote:
> Hello everyone,
>
> I am trying to send a sms throughout an application. I want the user
> to be redirected to the default sms interface, but I want to give in
> parameter the phone number of the receiver of the sms.
> Here is my code:
>
> Intent m_intent = new Intent(Intent.ACTION_VIEW);
> m_intent.putExtra(Intent.EXTRA_PHONE_NUMBER,"0600000000");
> m_intent.setType("vnd.android-dir/mms-sms");
> startActivity(m_intent);
>
> The problem here is that it doesn't take the value of the phone
> number, it is still empty.
>
> I also added this:
> m_intent.putExtra("sms_body", "Hello World");
> and it is working.
>
> Does anyone already tried this and find out how to do this ?
>
> Thanks in advance.

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to