什么是发送短信时,ACTION_SENDTO和ACTION_VIEW之间的区别? [英] what is the difference between ACTION_SENDTO and ACTION_VIEW when sending sms?

查看:550
本文介绍了什么是发送短信时,ACTION_SENDTO和ACTION_VIEW之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有将消息发送到指定联系人的应用程序。现在我用

I have an application that sends messages to a specified contact. Right now I use

Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("smsto:" + phoneNumber));

要发送消息,并且它的伟大工程在模拟器上和我的N1。我投诉的用户与HTC不可思议的是,他们得到的时候,他们用它强制关闭从android.mms应用程序。我没有更多的挖掘,我看到有很多的方式发送消息。例如

to send messages, and it works great on the emulator and on my N1. I got complaints from users with HTC incredible that they get force close from android.mms application when they use it. I did more digging and I see there are many ways for sending messages. For example

Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.parse("smsto:" + phoneNumber));

和也

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.putExtra("address", phoneNumber);
intent.setType("vnd.android-dir/mms-sms");

他们似乎都工作完全的仿真器和设备上是相同的,我找不到任何官方关于正确,普遍支持的方式。任何想法?

They all seem to work exactly the same on the emulator and on my device, and I could not find anything official about the correct, generally supported way. Any ideas?

推荐答案

我会尝试看看他们怎么做就的联系人应用

I will try to see how they did it on the Contacts apps.

在过去,我有很多的与HTC Hero的兼容性问题。我总是最后写上手机的Sense界面的工作的code。我发现,如果code工作在那里,它会工作的每个Android设备上。)

In the past I had lot's of compatibility issues with the HTC Hero. I always ended up writing the code that worked on phones with the Sense UI. I found out that if the code works there, it would work on every android device :).

这篇关于什么是发送短信时,ACTION_SENDTO和ACTION_VIEW之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆