黑莓 - setPayloadText不起作用 [英] Blackberry - setPayloadText doesn't work

查看:127
本文介绍了黑莓 - setPayloadText不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想,以打开一个prefilled消息SMS应用调用invokeApplication之前,使用的文字信息界面prepare短信。
地址(电话号码)效果很好(它的prefilled),但消息正文不。事实上,它似乎setPlayloadText方法没有效果。

I am trying to use the TexTMessage interface to prepare a SMS before invoking invokeApplication in order to open the SMS application with a prefilled message. The address (phone number) works well (it's prefilled) but the message body doesn't. Indeed it seems that the setPlayloadText method has no effect.

下面是我的code

messConn = (MessageConnection)Connector.open("sms://");
TextMessage sMess=(TextMessage)messConn.newMessage(MessageConnection.TEXT_MESSAGE);
sMess.setAddress("sms://123456789");
sMess.setPayloadText(new String("ahah")); //doesn't seem to work
Invoke.invokeApplication(Invoke.APP_TYPE_MESSAGES, new MessageArguments(sMess));

感谢您的帮助。

文森特

推荐答案

有是$ P $在某些操作系统版本被填充pvents的正文中的错误。您可以通过邮件的内容存储到剪贴板中,然后等待第二个左右的短信应用程序上来后注入粘贴操作绕过它。有点狡猾,但它是你可以在situtation唯一能做的。

There is a bug that prevents the body of the text from being populated in certain OS versions. You can get around it by storing the contents of the message to the clipboard, and then injecting a paste operation after waiting a second or so for the SMS app to come up. A little dodgy, but it's about the only thing you can do in that situtation.

另外,您也可以创建自己发送文本的屏幕,这是否给用户。你可以看看<一个href=\"http://supportforums.blackberry.com/t5/Java-Development/Different-ways-to-send-SMS-messages/ta-p/445070\">http://supportforums.blackberry.com/t5/Java-Development/Different-ways-to-send-SMS-messages/ta-p/445070这给如何以编程方式发送消息的指令。请注意,如果你这样做的方法,你应该使用两个,一个是备用方法,如果第一次失败。

Alternatively, you can create your own send-text screen that does this for the user. You can take a look at http://supportforums.blackberry.com/t5/Java-Development/Different-ways-to-send-SMS-messages/ta-p/445070 which gives instruction on how to programmatically send the message. Note that if you do this method, you should use both, with one being a fallback method if the first fails.

这篇关于黑莓 - setPayloadText不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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