安卓:ActivityNotFoundException试图发送特定设备上的MMS时,偶尔会遇到 [英] Android: ActivityNotFoundException occasionally encountered when trying to send MMS on specific devices

查看:603
本文介绍了安卓:ActivityNotFoundException试图发送特定设备上的MMS时,偶尔会遇到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是精彩的ACRA库报告,用户使用我的应用程序的测试版体验任何错误。什么到目前为止,它已经表明的是,一些用户在发送彩信的问题,而大多数没有。
 特别是我发现,使用Droid的仿生设备的用户遇到过这种错误,但是当我在本地运行的Droid仿生仿真器,我没有问题。
 在code我用它来启动MMS活动...

I am using the wonderful ACRA library to report any errors that users experience with the beta version of my app. What it has shown so far is that some users experience problems sending MMS messages, while most do not. In particular I found that a user using a Droid Bionic device experienced this error, but when I run the Droid Bionic emulator locally, I have don't have a problem. The code I use to start the MMS activity is...

File imageFile = new File(getContext().getFilesDir() + File.separator + fileName);
Uri uri = Uri.fromFile(imageFile);
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.setClassName("com.android.mms", "com.android.mms.ui.ComposeMessageActivity");
sendIntent.putExtra("sms_body", ""); 
sendIntent.putExtra(Intent.EXTRA_STREAM, uri);
sendIntent.setType("image/png");
getContext().startActivity(sendIntent);

我看到的错误 - 只有非常偶然 - 是:

The error I see - only very occasionally - is :

android.content.ActivityNotFoundException:无法找到明确的活动类{com.android.mms / com.android.mms.ui.ComposeMessageActivity};有你在你的Andr​​oidManifest.xml宣布这项活动?

android.content.ActivityNotFoundException: Unable to find explicit activity class {com.android.mms/com.android.mms.ui.ComposeMessageActivity}; have you declared this activity in your AndroidManifest.xml?

我怀疑是某些也许运营商已经修改了Android和重写/禁用默认MMS的活动。我真的没有测试这是所有物理设备和运营商我亲自测试它有这个code没有问题的好办法。正如我所提到的,在Droid仿生仿真器工作正常,但它是在有一个问题,现场的设备之一。

My suspicion is that perhaps certain carriers have modified Android and overridden/disabled the default MMS activity. I don't really have a good way of testing this as all the physical devices and carriers I have personally tested it on have no problem with this code. And as I mentioned, the Droid Bionic emulator works fine, but it was one of the devices in the field that had a problem.

我不知道是否有人已经经历过类似的事情,并有一个建议的解决方法?或者,如果有人在Android上发送MMS的所有设备上工作的方法/运营商。

I'm wondering if anyone has experienced something similar and has a suggested workaround? Or if someone has a method for sending MMS on Android that works on all devices/carriers.

(现在我只是捕捉异常,让用户知道,我不能与他们的设备发送彩信。)

(For now I am just catching the exception and letting the user know that I couldn't send MMS with their device.)

P.S。我在另一个论坛有人建议只删除的意图类名看到的。这样做的问题是,当你做的所有杂类型的应用程序说,他们可以处理这个意图(如EverNote的)的时候,其实我真的只是想彩信或没有。

p.s. I saw in another forum someone suggesting just removing the classname for the intent. The problem with that is when you do that all and sundry types of applications say they can handle the intent (e.g Evernote) when in fact I really just want MMS or nothing.

推荐答案

您可以做...


  1. 继续尝试这一做法,但赶上ActivityNotFoundException。

  2. 如果你得到一个ActivityNotFoundException,尝试推出用户可能已安装其他应用程序(VZMessages,Zlango消息,Handcent,ChompSMS等)。

  3. 如果所有的人都失败了,让你的用户知道您要发送彩信,然后启动意图,而不指定的类。这样,它是由用户选择一个应用程序,实际发送彩信。

这篇关于安卓:ActivityNotFoundException试图发送特定设备上的MMS时,偶尔会遇到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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